Article Directory
1 Introduction
Version 3.0 or greater will not have a problem, based on Vue CLI 3.0 build.
2, the source line Close
Add the following code in Vue.config.js
module.exports = {
// 关闭线上源码
productionSourceMap: false,
}
3, remove the console
Plug: Terminal execution
yarn add terser-webpack-plugin
Add the following code in vue.config.js
module.exports = {
configureWebpack:{
optimization:{
minimizer: [new TerserPlugin({ terserOptions: { compress: { drop_console: true } } })]
}
}
}
More use of plug-ins, please refer to: terser-WebPACK-plugin
学如逆水行舟,不进则退