提交 fe749e1d 编写于 作者: 雪洛's avatar 雪洛

docs: remove console by vue.config.js

上级 a4023a56
......@@ -19,8 +19,9 @@
* [开源项目资源汇总](casecode.md)
* [选型评估指南](select.md)
* [常见问题](faq.md)
* [更新日志](release.md)
* [Alpha版本更新日志](release-note-alpha.md)
* 更新日志
* [正式版](release.md)
* [Alpha版](release-note-alpha.md)
<!-- * [更新日志](//update.dcloud.net.cn/hbuilderx/changelog/2.1.1.20190716.html) -->
<!-- <li><a id="update-hock" href="javascript:;" target="__blank">更新日志</a></li> -->
<li class="show-sponsor-in-phone show-last"><a href="//ext.dcloud.net.cn/" target="__blank">插件市场</a></li>
......
......@@ -57,3 +57,22 @@ module.exports = {
}
```
**发布时删除console**
```js
module.exports = {
chainWebpack: (config) => {
// 发行或运行时启用了压缩时会生效
config.optimization.minimizer('terser').tap((args) => {
const compress = args[0].terserOptions
// 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...)
compress.drop_console = true
compress.pure_funcs = [
'__f__', // App 平台 vue 移除日志代码
// 'console.debug' // 可移除指定的 console 方法
]
return args
})
}
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册