From 24f38f86460357472b7511c233e6188c3de6a4ae Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 6 Mar 2017 20:21:28 -0500 Subject: [PATCH] Switch to preset-env (#1742) * Switch to preset-env Disables webpack modules by enabling babel modules to resolve #1638 * Bump babel-core to match babel preset versions * Add uglify to targets --- packages/babel-preset-react-app/index.js | 14 ++++++++++---- packages/babel-preset-react-app/package.json | 17 ++++++++--------- packages/react-scripts/package.json | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/babel-preset-react-app/index.js b/packages/babel-preset-react-app/index.js index 3760ec4e1ae..8236c64b54c 100644 --- a/packages/babel-preset-react-app/index.js +++ b/packages/babel-preset-react-app/index.js @@ -84,10 +84,16 @@ if (env === 'test') { module.exports = { presets: [ // Latest stable ECMAScript features - [require.resolve('babel-preset-latest'), { - 'es2015': { - modules: false - } + [require.resolve('babel-preset-env'), { + targets: { + // React parses on ie 9, so we should too + ie: 9, + // We currently minify with uglify + // Remove after https://github.com/mishoo/UglifyJS2/issues/448 + uglify: true + }, + // Disable polyfill transforms + useBuiltIns: false }], // JSX, Flow require.resolve('babel-preset-react') diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 049d75db3ee..aa955e43762 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -13,17 +13,16 @@ "dependencies": { "babel-plugin-dynamic-import-node": "1.0.0", "babel-plugin-syntax-dynamic-import": "6.18.0", - "babel-plugin-transform-class-properties": "6.22.0", - "babel-plugin-transform-object-rest-spread": "6.22.0", - "babel-plugin-transform-react-constant-elements": "6.22.0", - "babel-plugin-transform-react-jsx": "6.22.0", + "babel-plugin-transform-class-properties": "6.23.0", + "babel-plugin-transform-object-rest-spread": "6.23.0", + "babel-plugin-transform-react-constant-elements": "6.23.0", + "babel-plugin-transform-react-jsx": "6.23.0", "babel-plugin-transform-react-jsx-self": "6.22.0", "babel-plugin-transform-react-jsx-source": "6.22.0", "babel-plugin-transform-regenerator": "6.22.0", - "babel-plugin-transform-runtime": "6.22.0", - "babel-preset-env": "1.1.8", - "babel-preset-latest": "6.22.0", - "babel-preset-react": "6.22.0", - "babel-runtime": "6.22.0" + "babel-plugin-transform-runtime": "6.23.0", + "babel-preset-env": "1.2.1", + "babel-preset-react": "6.23.0", + "babel-runtime": "6.23.0" } } diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 2b334657d8c..33258dd8df3 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "autoprefixer": "6.7.5", - "babel-core": "6.22.1", + "babel-core": "6.23.1", "babel-eslint": "7.1.1", "babel-jest": "18.0.0", "babel-loader": "6.3.2",