mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-04-05 19:42:08 +08:00
24 lines
477 B
JavaScript
24 lines
477 B
JavaScript
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
|
||
|
||
const IS_PROD = ['production', 'prod'].includes(process.env.VUE_APP_ENV)
|
||
const plugins = [
|
||
[
|
||
'import',
|
||
{
|
||
libraryName: 'vant',
|
||
libraryDirectory: 'es',
|
||
style: true
|
||
},
|
||
'vant'
|
||
]
|
||
]
|
||
// 去除 console.log
|
||
if (IS_PROD) {
|
||
plugins.push('transform-remove-console')
|
||
}
|
||
|
||
module.exports = {
|
||
presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]],
|
||
plugins
|
||
}
|