vue-cli3打包隐藏console配置
作者:
Mr_HeH | 来源:发表于
2021-04-30 10:48 被阅读0次
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;
}
}
};
3.重新运行 npm run build 查看效果
本文标题:vue-cli3打包隐藏console配置
本文链接:https://www.haomeiwen.com/subject/fdlnrltx.html
网友评论