Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 090d5b4

Browse files
committed
Fix runtime detection in babel preset
1 parent 1af9e97 commit 090d5b4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ module.exports = function (api, opts, env) {
5454
);
5555
}
5656

57-
var hasJsxRuntime = Boolean(
58-
api.caller(caller => !!caller && caller.hasJsxRuntime)
59-
);
60-
6157
if (!isEnvDevelopment && !isEnvProduction && !isEnvTest) {
6258
throw new Error(
6359
'Using `babel-preset-react-app` requires that you specify `NODE_ENV` or ' +
@@ -99,8 +95,8 @@ module.exports = function (api, opts, env) {
9995
development: isEnvDevelopment || isEnvTest,
10096
// Will use the native built-in instead of trying to polyfill
10197
// behavior for any plugins that require one.
102-
...(!hasJsxRuntime ? { useBuiltIns: true } : {}),
103-
runtime: hasJsxRuntime ? 'automatic' : 'classic',
98+
...(opts.runtime !== 'automatic' ? { useBuiltIns: true } : {}),
99+
runtime: opts.runtime || 'classic',
104100
},
105101
],
106102
isTypeScriptEnabled && [require('@babel/preset-typescript').default],

0 commit comments

Comments
 (0)