-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.prod.js
32 lines (29 loc) · 887 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
const { merge } = require('webpack-merge')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const commonConfiguration = require('./webpack.common')
module.exports = merge(
commonConfiguration,
{
mode: 'production',
optimization: {
minimize: true,
minimizer: [
(compiler) => {
new TerserPlugin({
terserOptions: {
compress: {},
format: {
comments: false,
},
},
extractComments: false,
}).apply(compiler)
},
],
},
plugins: [
new CleanWebpackPlugin(),
],
},
)