babel.config.js 425 B

123456789101112131415161718192021
  1. module.exports = (api) => {
  2. let targets = {}
  3. if (api.env('test')) {
  4. targets.node = 'current'
  5. }
  6. return {
  7. presets: [
  8. ['@babel/preset-env', {
  9. modules: false,
  10. loose: true,
  11. targets
  12. }]
  13. ],
  14. plugins: [
  15. '@babel/plugin-proposal-object-rest-spread',
  16. '@babel/plugin-transform-object-assign',
  17. ['@babel/plugin-transform-react-jsx', { pragma: 'h' }]
  18. ]
  19. }
  20. }