You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

babel.config.legacy.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module.exports = {
  2. presets: [
  3. [
  4. '@babel/preset-env',
  5. {
  6. modules: false,
  7. targets: {
  8. browsers: [
  9. 'last 3 Chrome versions',
  10. 'last 3 Firefox versions',
  11. 'last 3 Safari versions',
  12. 'last 3 Edge versions',
  13. 'IE 11'
  14. ]
  15. },
  16. corejs: 3,
  17. useBuiltIns: 'entry'
  18. }
  19. ],
  20. '@babel/preset-react'
  21. ],
  22. plugins: [
  23. '@babel/plugin-proposal-class-properties',
  24. ['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
  25. 'lodash'
  26. ],
  27. env: {
  28. production: {
  29. plugins: [
  30. '@babel/plugin-syntax-dynamic-import',
  31. '@babel/plugin-transform-react-constant-elements'
  32. ]
  33. },
  34. development: {
  35. plugins: [
  36. '@babel/plugin-syntax-dynamic-import',
  37. '@babel/plugin-transform-react-jsx-source',
  38. '@babel/plugin-transform-react-jsx-self'
  39. ]
  40. },
  41. test: {
  42. plugins: [
  43. '@babel/plugin-transform-modules-commonjs',
  44. 'dynamic-import-node',
  45. '@babel/plugin-transform-react-jsx-source',
  46. '@babel/plugin-transform-react-jsx-self'
  47. ]
  48. }
  49. }
  50. };