Skip to content

Commit 31d5eca

Browse files
committed
Fix bad merge
1 parent 42511c7 commit 31d5eca

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/babel-preset-react-app/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ module.exports = function(api, opts) {
2323
opts = {};
2424
}
2525

26+
// This is similar to how `env` works in Babel:
27+
// https://babeljs.io/docs/usage/babelrc/#env-option
28+
// We are not using `env` because it’s ignored in versions > [email protected]:
29+
// https://github.com/babel/babel/issues/4539
30+
// https://github.com/facebook/create-react-app/issues/720
31+
// It’s also nice that we can enforce `NODE_ENV` being specified.
32+
var env = process.env.BABEL_ENV || process.env.NODE_ENV;
33+
var isEnvDevelopment = env === 'development';
34+
var isEnvProduction = env === 'production';
35+
var isEnvTest = env === 'test';
36+
var isFlowEnabled = validateBoolOption('flow', opts.flow, true);
37+
2638
if (!isEnvDevelopment && !isEnvProduction && !isEnvTest) {
2739
throw new Error(
2840
'Using `babel-preset-react-app` requires that you specify `NODE_ENV` or ' +

0 commit comments

Comments
 (0)