Loading... ## 前言 > 项目基于Vue CLI 3.0搭建,如果低于此版本可能会出现问题,高于此版本畅通无阻 ## 关闭线上源码 + 在Vue.config.js中添加如下代码 ```js module.exports = { // 关闭线上源码 productionSourceMap: false, } ``` ## 移除console + 安装插件:终端执行 ```js yarn add terser-webpack-plugin ``` + 在vue.config.js中添加如下代码 ```js module.exports = { configureWebpack:{ optimization:{ minimizer: [new TerserPlugin({ terserOptions: { compress: { drop_console: true } } })] } } } ``` Last modification:August 29th, 2020 at 06:08 am © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat