-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
41 lines (37 loc) · 1.17 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
const path = require('path');
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const baseConfig = require('./webpack.config.base.js');
module.exports = function(env) {
return webpackMerge(baseConfig, {
output: {
path: path.resolve(__dirname, 'dist-prod'),
filename: '[name].[hash].js'
},
devtool: 'nosources-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'LOG_LEVEL': JSON.stringify('none'),
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true
},
compress: {
screw_ie8: true
},
comments: false
}),
new webpack.optimize.ModuleConcatenationPlugin(),
],
});
};