vue-cli3打包隐藏console配置
2021-04-30 本文已影响0人
Mr_HeH
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;
}
}
};