vue-cli2项目:
build/webpack.prod.conf.js
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_console: true,//console
drop_debugger: true,
}
}
})
vue-cli3项目:
vue.config.js
module.exports = defineConfig({
chainWebpack(config) {
args[0].terserOptions.compress.drop_console = true;
args[0].terserOptions.compress.drop_debugger = true;
return args
}
})