getBabelConfig.js 921 B

123456789101112131415161718192021222324252627282930313233343536
  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. 'lodash',
  22. [
  23. '@babel/plugin-transform-runtime',
  24. {
  25. corejs: 3
  26. },
  27. ],
  28. [
  29. '@babel/plugin-proposal-decorators',
  30. {
  31. legacy: true,
  32. },
  33. ],
  34. ]
  35. };
  36. };