babel.config.js 567 B

12345678910111213141516171819202122232425262728
  1. const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
  2. const plugins = []
  3. if (IS_PROD) {
  4. plugins.push('transform-remove-console')
  5. }
  6. // lazy load ant-design-vue
  7. // if your use import on Demand, Use this code
  8. plugins.push(['import', {
  9. 'libraryName': 'ant-design-vue',
  10. 'libraryDirectory': 'es',
  11. 'style': true // `style: true` 会加载 less 文件
  12. }])
  13. module.exports = {
  14. presets: [
  15. '@vue/cli-plugin-babel/preset',
  16. [
  17. '@babel/preset-env',
  18. {
  19. 'useBuiltIns': 'entry',
  20. 'corejs': 3
  21. }
  22. ]
  23. ],
  24. plugins
  25. }