getBabelConfig.js 899 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports = ({ isESM }) => {
  2. return {
  3. presets: [
  4. [
  5. '@babel/preset-env',
  6. {
  7. modules: isESM ? false : 'commonjs',
  8. targets: {
  9. browsers: [
  10. "> 0.5%",
  11. "last 2 versions",
  12. "Firefox ESR",
  13. "not dead",
  14. "not IE 11"
  15. ]
  16. }
  17. },
  18. ],
  19. ],
  20. plugins: [
  21. [
  22. '@babel/plugin-transform-runtime',
  23. {
  24. corejs: 3
  25. },
  26. ],
  27. [
  28. '@babel/plugin-proposal-decorators',
  29. {
  30. legacy: true,
  31. },
  32. ],
  33. ]
  34. };
  35. };