babel.config.js 610 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. plugins.push('transform-class-properties')
  7. // lazy load ant-design-vue
  8. // if your use import on Demand, Use this code
  9. plugins.push(['import', {
  10. 'libraryName': 'ant-design-vue',
  11. 'libraryDirectory': 'es',
  12. 'style': true // `style: true` 会加载 less 文件
  13. }])
  14. module.exports = {
  15. presets: [
  16. '@vue/cli-plugin-babel/preset',
  17. [
  18. '@babel/preset-env',
  19. {
  20. 'useBuiltIns': 'entry',
  21. 'corejs': 3
  22. }
  23. ]
  24. ],
  25. plugins
  26. }