vue项目打包优化

在执行build命令期间移除所有的console

安装

1
npm install babel-plugin-transform-remove-console --save-dev

使用

1
2
3
4
5
6
7
8
9
// babel.config.js
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
'transform-remove-console'
]
}

重新打包


 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×