-
Notifications
You must be signed in to change notification settings - Fork 342
/
minimizers.js
33 lines (32 loc) · 1 KB
/
minimizers.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
import TerserPlugin from 'terser-webpack-plugin'
// import UglifyJsPlugin from 'uglifyjs-webpack-plugin'
import CssAssetsPlugin from 'optimize-css-assets-webpack-plugin'
export default () => [
new TerserPlugin({
// cache: true,
parallel: true,
minify: TerserPlugin.uglifyJsMinify,
// sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
output: { ascii_only: true },
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
},
}),
// new UglifyJsPlugin({
// cache: true,
// parallel: true,
// sourceMap: true,
// uglifyOptions: {
// output: { ascii_only: true },
// },
// }),
new CssAssetsPlugin({
cssProcessorOptions: {
autoprefixer: { disable: true },
parser: require('postcss-safe-parser'),
discardComments: {
removeAll: true,
},
},
}),
]