babel.config.js 737 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = function(api) {
  2. api.cache(true);
  3. const presets = [
  4. [
  5. '@babel/preset-env',
  6. {
  7. targets: {
  8. node: 'current',
  9. },
  10. },
  11. ],
  12. '@babel/preset-react',
  13. ];
  14. const plugins = [
  15. 'lodash',
  16. // transform
  17. // from `import { Button } from 'reactstrap';`
  18. // to `import Row from 'reactstrap/Button';`
  19. [
  20. 'transform-imports', {
  21. reactstrap: {
  22. // eslint-disable-next-line no-template-curly-in-string
  23. transform: 'reactstrap/es/${member}',
  24. preventFullImport: true,
  25. },
  26. },
  27. ],
  28. [
  29. '@babel/plugin-proposal-class-properties', { loose: true },
  30. ],
  31. ];
  32. return {
  33. presets,
  34. plugins,
  35. };
  36. };