1. 通过npm安装插件
npm install terser-webpack-plugin --save-dev
2.配置vue.config.js
module.exports = {
transpileDependencies: ["vuetify"],
publicPath: "./",
lintOnSave: false,
configureWebpack: config => {
if (process.env.NODE_ENV === "production") {
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true;
}
}
};
网友评论