赞
踩
uniapp默认情况下是没有vue.config.js的,我们只需要新建添加以下代码:
module.exports = {
productionSourceMap: false, // 生产打包时不输出map文件,增加打包速度
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
}
}
}
uniapp下的vue.config.js的介绍:
https://uniapp.dcloud.io/collocation/vue-config
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。