-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.prod.js
36 lines (35 loc) · 916 Bytes
/
webpack.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
const merge = require('webpack-merge')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const safeParser = require('postcss-safe-parser')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const webpack = require('webpack')
const common = require('./webpack.common.js')
module.exports = merge(common, {
plugins: [
new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
autoprefixer: { disable: true },
discardComments: {
removeAll: true
},
mergeLonghand: false,
parser: safeParser,
safe: true
},
}),
new UglifyJSPlugin({
uglifyOptions: {
output: {
comments: false
},
compress: {
dead_code: true
}
}
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
],
mode: 'production'
})