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
};