babel.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. module.exports = {
  2. presets: [
  3. // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
  4. '@vue/cli-plugin-babel/preset', '@babel/preset-env'
  5. ],
  6. 'env': {
  7. 'development': {
  8. // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
  9. // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
  10. 'plugins': ['dynamic-import-node',]
  11. }
  12. },
  13. plugins: [
  14. [
  15. 'import',
  16. {
  17. libraryName: 'vant',
  18. libraryDirectory: 'es',
  19. style: true,
  20. },
  21. 'vant',
  22. ],
  23. '@babel/plugin-proposal-optional-chaining',
  24. '@babel/plugin-proposal-nullish-coalescing-operator'
  25. ],
  26. }
  27. // module.exports = {
  28. // presets: [
  29. // '@vue/babel-preset-jsx',
  30. // [
  31. // '@babel/preset-env',
  32. // {
  33. // 'useBuiltIns': 'entry',
  34. // 'corejs': 3
  35. // }
  36. // ]
  37. // ],
  38. // 'env': {
  39. // 'development': {
  40. // 'plugins': ['dynamic-import-node']
  41. // }
  42. // }
  43. // }