-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack-prod.config.js
47 lines (41 loc) · 1.1 KB
/
webpack-prod.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
37
38
39
40
41
42
43
44
45
46
47
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const webpackCommon = require('./webpack-common.config');
module.exports = webpackMerge(webpackCommon, {
entry: {
main: [
'./src/index.jsx'
],
},
module: {
rules: [
{
test: /\.jsx?$/,
use: {
loader: 'babel-loader',
options: {
presets: ['env', 'stage-1', 'react'],
}
},
exclude: /node_modules/,
},
]
},
stats: {
chunks: true,
modules: false
},
plugins: [
new webpack.DefinePlugin({
DEV: false,
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
}),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
],
});