Skip to content

Commit c989b70

Browse files
committed
Further tweak runtime plugin per documentation
1 parent 054ba79 commit c989b70

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: packages/babel-preset-react-app/create.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,18 @@ module.exports = function(api, opts, env) {
107107
useBuiltIns: true,
108108
},
109109
],
110-
// Polyfills the runtime needed for async/await and generators
110+
// Polyfills the runtime needed for async/await, generators, and friends
111+
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
111112
[
112113
require('@babel/plugin-transform-runtime').default,
113114
{
115+
corejs: false,
114116
helpers: false,
115117
regenerator: true,
118+
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
119+
// We should turn this on once the lowest version of Node LTS
120+
// supports ES Modules.
121+
useESModules: isEnvDevelopment || isEnvProduction,
116122
},
117123
],
118124
isEnvProduction && [

0 commit comments

Comments
 (0)