babel.config.js 611 B

12345678910111213141516171819202122232425262728293031
  1. module.exports = {
  2. presets: [
  3. [
  4. "@babel/preset-env",
  5. {
  6. modules: false
  7. }
  8. ],
  9. "@babel/preset-react"
  10. ],
  11. plugins: [
  12. "@babel/plugin-transform-runtime",
  13. "@babel/plugin-syntax-dynamic-import",
  14. "@babel/plugin-proposal-class-properties"
  15. ],
  16. env: {
  17. production: {
  18. only: ["src"],
  19. plugins: [
  20. [
  21. "transform-react-remove-prop-types",
  22. {
  23. removeImport: true
  24. }
  25. ],
  26. "@babel/plugin-transform-react-inline-elements",
  27. "@babel/plugin-transform-react-constant-elements"
  28. ]
  29. }
  30. }
  31. };