Blame view
src/vue.config.js
993 Bytes
|
7b2f948d4
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// const webpackApiMocker = require('mocker-api')
// module.exports = {
// devServer: {
// before(app) {
// webpackApiMocker(app, path.resolve('./mock/index.js'))
// },
// proxy: {
// '/app/prod/list': {
// target: 'https://api.glass.xiuyetang.com/',
// pathRewrite: {
// '^/app': ''
// }
// }
// },
// }
|
|
c00dd2818
|
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
// }
module.exports = {
chainWebpack: (config) => {
// 发行或运行时启用了压缩时会生效
config.optimization.minimizer('terser').tap((args) => {
const compress = args[0].terserOptions.compress
// 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...)
compress.drop_console = true
compress.pure_funcs = [
'__f__', // App 平台 vue 移除日志代码
// 'console.debug' // 可移除指定的 console 方法
]
return args
})
},
}
|