diff --git a/.babelrc b/.babelrc index fe25eab7af..09e4456ccb 100644 --- a/.babelrc +++ b/.babelrc @@ -1,10 +1,9 @@ { "presets": [ [ - "env", { - "es2015": { - "modules": false - } + "env", + { + "modules": false } ], "react", @@ -13,6 +12,9 @@ "env": { "development": { "plugins": "react-hot-loader/babel" + }, + "test": { + "plugins": ["transform-es2015-modules-commonjs"] } }, "plugins": [ diff --git a/package-lock.json b/package-lock.json index d41ef8b0e9..004cb0329d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -145,7 +145,7 @@ "babel-core": "6.26.0", "babel-loader": "7.1.2", "babel-plugin-react-docgen": "1.7.0", - "babel-preset-env": "1.6.0", + "babel-preset-env": "1.6.1", "babel-preset-minify": "0.2.0", "babel-preset-react": "6.24.1", "babel-preset-react-app": "3.0.2", @@ -1860,9 +1860,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -1896,54 +1896,6 @@ "semver": "5.4.1" } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" - } - }, - "babel-preset-es2016": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz", - "integrity": "sha1-+QC/k+LrwNJ235uKtZck6/2Vn4s=", - "requires": { - "babel-plugin-transform-exponentiation-operator": "6.24.1" - } - }, - "babel-preset-es2017": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz", - "integrity": "sha1-WXvq37n38gi8/YoS6bKym4svFNE=", - "requires": { - "babel-plugin-syntax-trailing-function-commas": "6.22.0", - "babel-plugin-transform-async-to-generator": "6.24.1" - } - }, "babel-preset-flow": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", @@ -1961,16 +1913,6 @@ "babel-plugin-jest-hoist": "20.0.3" } }, - "babel-preset-latest": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz", - "integrity": "sha1-Z33gaRVKdIXC0lxXfAL2JLhbheg=", - "requires": { - "babel-preset-es2015": "6.24.1", - "babel-preset-es2016": "6.24.1", - "babel-preset-es2017": "6.24.1" - } - }, "babel-preset-minify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.2.0.tgz", @@ -13125,16 +13067,16 @@ } }, "react-hot-loader": { - "version": "3.0.0-beta.7", - "resolved": "https://registry.npmjs.org/react-hot-loader/-/react-hot-loader-3.0.0-beta.7.tgz", - "integrity": "sha1-1YR7gWXXMcTVsw2G1dRxYieg+oM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/react-hot-loader/-/react-hot-loader-3.0.0.tgz", + "integrity": "sha512-5CWQPoaZ7lQ2GXzBv2A+6RH7iJxc4drxx/EPUIpRR0jP9tDsZb/6eBOAJL2OjONYsODRWhECLgmbvupvQHqY7g==", "requires": { "babel-template": "6.26.0", "global": "4.3.2", "react-deep-force-update": "2.1.1", "react-proxy": "3.0.0-alpha.1", "redbox-react": "1.5.0", - "source-map": "0.4.4" + "source-map": "0.6.1" }, "dependencies": { "react-deep-force-update": { @@ -13151,12 +13093,9 @@ } }, "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "requires": { - "amdefine": "1.0.1" - } + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, @@ -14929,11 +14868,6 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, "string-convert": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", @@ -14993,6 +14927,11 @@ "function-bind": "1.1.1" } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/package.json b/package.json index 654790ca67..29263fe502 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,7 @@ "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-runtime": "^6.15.0", "babel-polyfill": "^6.16.0", - "babel-preset-env": "^1.5.1", - "babel-preset-es2015": "^6.24.1", - "babel-preset-latest": "^6.24.1", + "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "babel-preset-react-hmre": "^1.1.1", "babel-preset-stage-2": "^6.24.1", diff --git a/webpack/webpack.server.config.js b/webpack/webpack.server.config.js index 69b498612a..f8c25d0662 100644 --- a/webpack/webpack.server.config.js +++ b/webpack/webpack.server.config.js @@ -53,7 +53,7 @@ module.exports = { use: { loader: 'babel-loader', options: { - presets: ['es2015', 'react', 'stage-2'], + presets: ['env', 'react', 'stage-2'], plugins: ['transform-decorators-legacy', 'transform-runtime'], cacheDirectory: true, },