-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
36 lines (32 loc) · 889 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
32
33
34
35
36
var path = require('path'),
webpack = require('webpack');
var envPlugin = new webpack.DefinePlugin({
'process.env': {NODE_ENV:'"production"'},
__DEV__: !process.env.BUILD_RELEASE
});
var plugins = [envPlugin];
if(process.env.BUILD_RELEASE) {
plugins.push(new webpack.optimize.DedupePlugin());
plugins.push(new webpack.optimize.UglifyJsPlugin([]));
} else {
plugins.push(new webpack.HotModuleReplacementPlugin());
plugins.push(new webpack.NoErrorsPlugin());
}
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'build'),
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loaders: ['react-hot', 'babel']
}
]
},
plugins: plugins
};