babel.config.js 488 B

12345678910111213141516171819202122
  1. // 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
  2. // const IS_PROD = ['production', 'prod'].includes(process.env.VUE_APP_ENV)
  3. const plugins = [
  4. [
  5. 'import',
  6. {
  7. libraryName: 'vant',
  8. libraryDirectory: 'es',
  9. style: true
  10. },
  11. 'vant'
  12. ]
  13. ]
  14. // 去除 console.log
  15. // if (IS_PROD) {
  16. // plugins.push('transform-remove-console')
  17. // }
  18. module.exports = {
  19. presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]],
  20. plugins
  21. }