From 5782c0240555d1857d134b23842c27c19f22012c Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 14 Nov 2019 23:13:05 +0800 Subject: [PATCH] chore: revert some unneccessary changes --- babel.config.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/babel.config.js b/babel.config.js index 32dcafe11a..16f93e4b11 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,7 +1,7 @@ // @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration module.exports = (api) => { - const env = api.cache(() => process.env.NODE_ENV); - if(env === 'site') { + api.cache(() => process.env.NODE_ENV); + if(api.env('site')) { return { "presets": [ "babel-preset-gatsby" @@ -38,7 +38,12 @@ module.exports = (api) => { }, }, ], - '@babel/preset-react', + [ + '@babel/preset-react', + { + development: process.env.BABEL_ENV !== 'build', + }, + ], '@babel/preset-typescript', ], plugins: [