diff --git a/babel.config.js b/babel.config.js index 12a0e78baf..3ecbb2d4cc 100644 --- a/babel.config.js +++ b/babel.config.js @@ -25,12 +25,15 @@ module.exports = api => { targets.chrome = minChromeVersion.toString(); targets.firefox = minFirefoxVersion.toString(); } + const plugins = [ + ['@babel/plugin-transform-flow-strip-types'], + ['@babel/plugin-proposal-class-properties', { loose: false }], + ]; + if (process.env.NODE_ENV === 'development') { + plugins.push(['@babel/plugin-transform-react-jsx-source']); + } return { - plugins: [ - ['@babel/plugin-transform-flow-strip-types'], - ['@babel/plugin-proposal-class-properties', { loose: false }], - ['@babel/plugin-transform-react-jsx-source'], - ], + plugins, presets: [ ['@babel/preset-env', { targets }], '@babel/preset-react',