-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.production.js
48 lines (47 loc) · 1.21 KB
/
webpack.config.production.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var path = require("path");
var webpack = require("webpack");
var BundleTracker = require("webpack-bundle-tracker");
var ExtractText = require("extract-text-webpack-plugin");
var CompressionPlugin = require('compression-webpack-plugin');
module.exports = {
entry: ["./turkers/chats/react/src/js/index"],
output: {
path: path.resolve("./turkers/chats/static/chats/dist/"),
filename: "[name]-[hash].js",
publicPath: "/static/chats/dist/" // Tell django to use this URL to load packages and not use STATIC_URL + bundle_name
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
test: /\.css$/,
loader: ["style-loader", "css-loader"]
},
{
test: /\.scss$/,
use: ExtractText.extract({
fallback: "style-loader",
use: ["css-loader", "sass-loader"]
})
}
]
},
plugins: [
new BundleTracker({
path: __dirname,
filename: "turkers/webpack-stats.json"
}),
new ExtractText({
filename: "[name]-[hash].css"
}),
new CompressionPlugin()
],
resolve: {
modules: ["node_modules"],
extensions: [".js", ".jsx"]
}
};