babel.config.json 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {
  2. "presets": [
  3. [
  4. "@babel/env",
  5. {
  6. "useBuiltIns": "usage",
  7. // This version must be aligned with the `core-js` version in `package.json`
  8. "corejs": { "version": "3.30" },
  9. "exclude": [
  10. // Exclude Array.prototype.push polyfill, as it's not needed and affects performance in Chrome
  11. "es.array.push",
  12. // Exclude objectSpread polyfill, as it's not needed and affects performance
  13. "@babel/plugin-transform-object-rest-spread",
  14. // Exclude _defineProperty polyfill, as it causes a bug without the objectSpread polyfill
  15. "@babel/plugin-transform-computed-properties",
  16. // Use native async functions, for performance
  17. "@babel/plugin-transform-async-to-generator",
  18. // Use native generators, for performance
  19. "@babel/plugin-transform-regenerator",
  20. // Use native async generators, for performance
  21. "@babel/plugin-transform-async-generator-functions",
  22. // Use native for-of loops, for performance
  23. "@babel/plugin-transform-for-of"
  24. ]
  25. }
  26. ],
  27. ["@babel/react", { "runtime": "automatic" }],
  28. "@babel/typescript"
  29. ],
  30. "plugins": ["angularjs-annotate", "macros"],
  31. "overrides": [
  32. // treat .cjs files (e.g. libraries symlinked into node_modules) as commonjs
  33. {
  34. "test": "../../**/*.cjs",
  35. "sourceType": "script"
  36. }
  37. ]
  38. }