-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.prod.js
40 lines (36 loc) · 1.13 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
const path = require('path');
const webpackMerge = require('webpack-merge');
const webpack = require('webpack');
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('+error,-warn,-info,-log,+perf')
}
}),
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
})
],
});
};