-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
31 lines (30 loc) · 967 Bytes
/
webpack.config.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
// webpack.config.js
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: path.join(__dirname, 'src', 'client.js'),
output: {
path: path.join(__dirname, 'src', 'public', 'js'),
filename: 'bundle.js'
},
module: {
loaders: [{
test: path.join(__dirname, 'src'),
loader: ['babel-loader?presets[]=react,presets[]=es2015,presets[]=stage-0,cacheDirectory=babel_cache']
}]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: process.env.NODE_ENV === "development" ? false : { warnings: false },
mangle: process.env.NODE_ENV !== "development",
sourcemap: false,
beautify: process.env.NODE_ENV === "development",
dead_code: true
}),
new webpack.optimize.ModuleConcatenationPlugin()
]
};