From 7ef5970b2f5f65d09329fd71fbe7df9fde478d67 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 4 Jun 2019 17:03:13 -0700 Subject: [PATCH] Removed __source info from production builds --- babel.config.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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',