vue 在生产环境下,屏蔽console.log在控制台的输出
1.npm安装插件:npm install babel-plugin-transform-remove-console --save-dev2.根目录:babel.config.jsconst plugins = []if (process.env.NODE_ENV != 'development') {plugins.push('transform-remove-console')}module
·
1.npm安装插件:npm install babel-plugin-transform-remove-console --save-dev
2.根目录:babel.config.js
const plugins = []
if (process.env.NODE_ENV != 'development') {
plugins.push('transform-remove-console')
}
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: plugins
};
更多推荐
已为社区贡献2条内容
所有评论(0)