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.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module.exports = {
  2. compact: true,
  3. presets: [
  4. [
  5. '@babel/preset-env',
  6. {
  7. modules: false,
  8. targets: {
  9. browsers: [
  10. 'last 2 Chrome versions',
  11. 'last 2 Firefox versions',
  12. 'last 2 Safari versions',
  13. 'last 2 Edge versions'
  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. };