-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
50 lines (49 loc) · 1.22 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
// jscs:disable
var path = require('path');
var webpack = require('webpack');
var AssetsPlugin = require('assets-webpack-plugin');
module.exports = {
devtool: false,
entry: {
main: ['./src/client.js'],
vendor: [
'react',
'react-dom',
'react-router',
'redux',
'react-redux',
'aphrodite'
]
},
output: {
path: __dirname + '/build/static',
filename: '[name]_[hash].js',
chunkFilename: '[id].chunk_[hash].js',
publicPath: '/build/static/'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor_[hash].js', 2),
new webpack.optimize.DedupePlugin(),
new AssetsPlugin({filename: 'assets.json'}),
new webpack.optimize.UglifyJsPlugin({
compress: {
unused: true,
dead_code: true,
warnings: false,
screw_ie8: true,
}
}),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
})
],
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader?presets[]=es2015&presets[]=react&presets[]=stage-0',
include: path.join(__dirname, 'src')
}]
}
};