Skip to content

Commit 56c839e

Browse files
committed
Let babel determine features to compile
1 parent 15b91e2 commit 56c839e

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,13 @@ module.exports = function(api, opts) {
4646
// Latest stable ECMAScript features
4747
require('@babel/preset-env').default,
4848
{
49-
targets: {
50-
// React parses on ie 9, so we should too
51-
ie: 9,
52-
},
53-
// We currently minify with uglify
54-
// Remove after https://github.com/mishoo/UglifyJS2/issues/448
55-
forceAllTransforms: true,
56-
// Disable polyfill transforms
57-
useBuiltIns: false,
58-
// Do not transform modules to CJS
49+
// `entry` transforms `@babel/polyfill` into individual requires for
50+
// the targeted browsers. This is safer than `usage` which performs
51+
// static code analysis to determine what's required.
52+
// This is probably a fine default to help trim down bundles when
53+
// end-users inevitably import '@babel/polyfill'.
54+
useBuiltIns: 'entry',
55+
// Do not transform modules to CJS.
5956
modules: false,
6057
},
6158
],
@@ -104,7 +101,7 @@ module.exports = function(api, opts) {
104101
!isEnvTest && [
105102
require('@babel/plugin-transform-regenerator').default,
106103
{
107-
// Async functions are converted to generators by babel-preset-env
104+
// Async functions are converted to generators by @babel/preset-env
108105
async: false,
109106
},
110107
],

0 commit comments

Comments
 (0)