-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.prod.js
55 lines (51 loc) · 1.04 KB
/
webpack.config.prod.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
49
50
51
52
53
54
55
var path = require("path");
var webpack = require('webpack');
var NodeNeat = require("node-neat");
module.exports = {
context: __dirname,
entry: {
'root': './static/js/root',
'style': './static/js/style',
},
output: {
path: path.resolve('./static/bundles/'),
filename: "[name].js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}, // to transform JSX into JS
{
test: /\.scss$/,
exclude: /node_modules/,
loader: 'style!css!sass'
}
]
},
sassLoader: {
includePaths: NodeNeat.includePaths
},
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.jsx']
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
devtool: 'source-map'
};