From d1320548a455cdab42c45e76d592e12a274fefb9 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Wed, 19 Sep 2018 15:23:58 -0400 Subject: [PATCH] Lock babel configuration back to IE 9 support (ES5) --- packages/babel-preset-react-app/create.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/create.js b/packages/babel-preset-react-app/create.js index 2ead09570f6..70bd4e8e478 100644 --- a/packages/babel-preset-react-app/create.js +++ b/packages/babel-preset-react-app/create.js @@ -45,7 +45,7 @@ module.exports = function(api, opts, env) { require('@babel/preset-env').default, { targets: { - node: '6.12', + node: 'current', }, }, ], @@ -53,6 +53,14 @@ module.exports = function(api, opts, env) { // Latest stable ECMAScript features require('@babel/preset-env').default, { + // We want Create React App to be IE 9 compatible until React itself + // no longer works with IE 9 + targets: { + ie: 9, + }, + // Users cannot override this behavior because this Babel + // configuration is highly tuned for ES5 support + ignoreBrowserslistConfig: true, // `entry` transforms `@babel/polyfill` into individual requires for // the targeted browsers. This is safer than `usage` which performs // static code analysis to determine what's required.