uglifyjs-webpack-plugin 插件废弃,改用uglifyjs-webpack-plugin
uglifyjs-webpack-plugin压缩es6代码报错,后续也不会更新,改用uglifyjs-webpack-plugin>压缩代码,配置如下,
详细配置说明:https://github.com/terser/terser#compress-options
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
configureWebpack: {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
pure_funcs: ["console.log"]
}
}
})
]
}
}
来源:https://segmentfault.com/a/1190000020185466?utm_source=tag-newest