chore(v2): switch from uglifyjs-webpack-plugin to terser-webpack-plugin (#1099)

This commit is contained in:
Endilie Yacop Sucipto 2018-11-08 10:58:52 +08:00 committed by GitHub
parent 8695ed89a6
commit fc7ba5b6b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 148 additions and 21 deletions

View file

@ -7,7 +7,7 @@
const Config = require('webpack-chain');
const CSSExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const mdLoader = require.resolve('./loaders/markdown');
@ -154,15 +154,17 @@ module.exports = function createBaseConfig(props, isServer) {
if (isProd) {
config.optimization.minimizer([
new UglifyJsPlugin({
new TerserPlugin({
cache: true,
uglifyOptions: {
warnings: false,
compress: false,
parallel: true,
sourceMap: true,
terserOptions: {
ecma: 6,
mangle: true,
output: {
comments: false,
},
},
sourceMap: true,
}),
]);
}