使用插件 babel-plugin-transform-remove-console
1. 安装
npm install babel-plugin-transform-remove-console --save-dev
2. 使用
// babel.config.js
const productPlugins = [] // 项目发布阶段所需要的 babel 插件
if (process.env.NODE_ENV === 'production'
使用插件 babel-plugin-transform-remove-console
npm install babel-plugin-transform-remove-console --save-dev
// babel.config.js
const productPlugins = [] // 项目发布阶段所需要的 babel 插件
if (process.env.NODE_ENV === 'production'