vue项目发布时去除console语句
在vue.config.js中添加下面的代码即可
1 // vue-cli version > 3 2 modeule.exports = { 3 configureWebpack: config => { 4 if (process.env.NODE_ENV === "production") { 5 config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true; 6 } 7 }, 8 }
本文来自博客园,作者:_zhiqiu,转载请注明原文链接:https://www.cnblogs.com/guojikun/p/13284333.html