babel.config.js 663 B

12345678910111213141516171819202122232425262728293031
  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. plugins.push("@babel/plugin-transform-runtime")
  6. }
  7. module.exports = {
  8. presets: [
  9. '@vue/app',
  10. [
  11. '@babel/preset-env',
  12. {
  13. 'useBuiltIns': 'entry',
  14. 'targets': '> 0.25%, not dead',
  15. 'corejs': 2
  16. }
  17. ]
  18. ],
  19. plugins
  20. // if your use import on Demand, Use this code
  21. // ,
  22. // plugins: [
  23. // [ 'import', {
  24. // 'libraryName': 'ant-design-vue',
  25. // 'libraryDirectory': 'es',
  26. // 'style': true // `style: true` 会加载 less 文件
  27. // } ]
  28. // ]
  29. }