1.npm i uglifyjs-webpack-plugin -D下载所需要的依赖
2.在vue.config.js中引入
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
3.module.exports = {
configureWebpack:{
optimization:{
minimizer:[
new UglifyJsPlugin({
uglifyOptions:{
warnings:false,
compress:{
pure_funcs: ['console.log','console.debug']
}
}
})]
}
}
}