Skip to content

Commit

Permalink
Use babel-preset-env instead of babel-preset-latest. (vercel#1701)
Browse files Browse the repository at this point in the history
Here we don't use the full capabilities of babel-preset-env.
But it's recommended to use it without browser configs as
a substitute for babel-preset-latest.
That's why we did this.
  • Loading branch information
arunoda authored Apr 18, 2017
1 parent b3f15f8 commit e0f71d8
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"latest",
"env",
"react"
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.0",
"babel-plugin-transform-runtime": "6.22.0",
"babel-preset-latest": "6.24.0",
"babel-preset-env": "1.3.3",
"babel-preset-react": "6.23.0",
"babel-runtime": "6.23.0",
"case-sensitive-paths-webpack-plugin": "2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions server/build/babel/preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const plugins = envPlugins[process.env.NODE_ENV] || []

module.exports = {
presets: [
[require.resolve('babel-preset-latest'), {
'es2015': { modules: false }
[require.resolve('babel-preset-env'), {
modules: false
}],
require.resolve('babel-preset-react')
],
Expand Down
96 changes: 62 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoping@^6.22.0:
babel-plugin-transform-es2015-block-scoping@^6.22.0, babel-plugin-transform-es2015-block-scoping@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51"
dependencies:
Expand All @@ -563,7 +563,7 @@ babel-plugin-transform-es2015-block-scoping@^6.22.0:
babel-types "^6.23.0"
lodash "^4.2.0"

babel-plugin-transform-es2015-classes@^6.22.0:
babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1"
dependencies:
Expand All @@ -584,7 +584,7 @@ babel-plugin-transform-es2015-computed-properties@^6.22.0:
babel-runtime "^6.22.0"
babel-template "^6.22.0"

babel-plugin-transform-es2015-destructuring@^6.22.0:
babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
dependencies:
Expand All @@ -597,7 +597,7 @@ babel-plugin-transform-es2015-duplicate-keys@^6.22.0:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-plugin-transform-es2015-for-of@^6.22.0:
babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
dependencies:
Expand All @@ -617,15 +617,15 @@ babel-plugin-transform-es2015-literals@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-modules-amd@^6.24.0:
babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.0:
version "6.24.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e"
dependencies:
babel-plugin-transform-es2015-modules-commonjs "^6.24.0"
babel-runtime "^6.22.0"
babel-template "^6.22.0"

[email protected], babel-plugin-transform-es2015-modules-commonjs@^6.24.0:
[email protected], babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.0:
version "6.24.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f"
dependencies:
Expand All @@ -634,15 +634,15 @@ [email protected], babel-plugin-transform-es
babel-template "^6.23.0"
babel-types "^6.23.0"

babel-plugin-transform-es2015-modules-systemjs@^6.22.0:
babel-plugin-transform-es2015-modules-systemjs@^6.22.0, babel-plugin-transform-es2015-modules-systemjs@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0"
dependencies:
babel-helper-hoist-variables "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"

babel-plugin-transform-es2015-modules-umd@^6.24.0:
babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.0:
version "6.24.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450"
dependencies:
Expand All @@ -657,7 +657,7 @@ babel-plugin-transform-es2015-object-super@^6.22.0:
babel-helper-replace-supers "^6.22.0"
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-parameters@^6.22.0:
babel-plugin-transform-es2015-parameters@^6.22.0, babel-plugin-transform-es2015-parameters@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b"
dependencies:
Expand Down Expand Up @@ -695,7 +695,7 @@ babel-plugin-transform-es2015-template-literals@^6.22.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
dependencies:
Expand Down Expand Up @@ -786,7 +786,41 @@ babel-plugin-transform-strict-mode@^6.22.0:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

[email protected], babel-preset-es2015@^6.24.0:
[email protected]:
version "1.3.3"
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.3.3.tgz#5913407784e3d98de2aa814a3ef9059722b34e0b"
dependencies:
babel-plugin-check-es2015-constants "^6.22.0"
babel-plugin-syntax-trailing-function-commas "^6.22.0"
babel-plugin-transform-async-to-generator "^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.23.0"
babel-plugin-transform-es2015-classes "^6.23.0"
babel-plugin-transform-es2015-computed-properties "^6.22.0"
babel-plugin-transform-es2015-destructuring "^6.23.0"
babel-plugin-transform-es2015-duplicate-keys "^6.22.0"
babel-plugin-transform-es2015-for-of "^6.23.0"
babel-plugin-transform-es2015-function-name "^6.22.0"
babel-plugin-transform-es2015-literals "^6.22.0"
babel-plugin-transform-es2015-modules-amd "^6.22.0"
babel-plugin-transform-es2015-modules-commonjs "^6.23.0"
babel-plugin-transform-es2015-modules-systemjs "^6.23.0"
babel-plugin-transform-es2015-modules-umd "^6.23.0"
babel-plugin-transform-es2015-object-super "^6.22.0"
babel-plugin-transform-es2015-parameters "^6.23.0"
babel-plugin-transform-es2015-shorthand-properties "^6.22.0"
babel-plugin-transform-es2015-spread "^6.22.0"
babel-plugin-transform-es2015-sticky-regex "^6.22.0"
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.22.0"
babel-plugin-transform-exponentiation-operator "^6.22.0"
babel-plugin-transform-regenerator "^6.22.0"
browserslist "^1.4.0"
invariant "^2.2.2"

[email protected]:
version "6.24.0"
resolved "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a"
dependencies:
Expand Down Expand Up @@ -815,19 +849,6 @@ [email protected], babel-preset-es2015@^6.24.0:
babel-plugin-transform-es2015-unicode-regex "^6.22.0"
babel-plugin-transform-regenerator "^6.22.0"

babel-preset-es2016@^6.22.0:
version "6.22.0"
resolved "https://registry.npmjs.org/babel-preset-es2016/-/babel-preset-es2016-6.22.0.tgz#b061aaa3983d40c9fbacfa3743b5df37f336156c"
dependencies:
babel-plugin-transform-exponentiation-operator "^6.22.0"

babel-preset-es2017@^6.22.0:
version "6.22.0"
resolved "https://registry.npmjs.org/babel-preset-es2017/-/babel-preset-es2017-6.22.0.tgz#de2f9da5a30c50d293fb54a0ba15d6ddc573f0f2"
dependencies:
babel-plugin-syntax-trailing-function-commas "^6.22.0"
babel-plugin-transform-async-to-generator "^6.22.0"

babel-preset-flow@^6.23.0:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d"
Expand All @@ -846,14 +867,6 @@ babel-preset-jest@^19.0.0:
dependencies:
babel-plugin-jest-hoist "^19.0.0"

[email protected]:
version "6.24.0"
resolved "https://registry.npmjs.org/babel-preset-latest/-/babel-preset-latest-6.24.0.tgz#a68d20f509edcc5d7433a48dfaebf7e4f2cd4cb7"
dependencies:
babel-preset-es2015 "^6.24.0"
babel-preset-es2016 "^6.22.0"
babel-preset-es2017 "^6.22.0"

[email protected]:
version "6.23.0"
resolved "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.23.0.tgz#eb7cee4de98a3f94502c28565332da9819455195"
Expand Down Expand Up @@ -1074,6 +1087,13 @@ browserify-zlib@^0.1.4:
dependencies:
pako "~0.2.0"

browserslist@^1.4.0:
version "1.7.7"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9"
dependencies:
caniuse-db "^1.0.30000639"
electron-to-chromium "^1.2.7"

[email protected]:
version "1.0.2"
resolved "https://registry.npmjs.org/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169"
Expand Down Expand Up @@ -1144,6 +1164,10 @@ camelcase@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"

caniuse-db@^1.0.30000639:
version "1.0.30000650"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000650.tgz#615f564d367533d32b82d72ada09661e75386bab"

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.0.0.tgz#60142d7d0beabdb35676ef0aeace3027da0578ba"
Expand Down Expand Up @@ -1666,6 +1690,10 @@ [email protected]:
version "1.1.1"
resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"

electron-to-chromium@^1.2.7:
version "1.3.3"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.3.tgz#651eb63fe89f39db70ffc8dbd5d9b66958bc6a0e"

elegant-spinner@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e"
Expand Down Expand Up @@ -2576,7 +2604,7 @@ interpret@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"

invariant@^2.2.0:
invariant@^2.2.0, invariant@^2.2.2:
version "2.2.2"
resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
dependencies:
Expand Down Expand Up @@ -4005,7 +4033,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.2, prop-types@^15.5.6, prop-types@~15.5.0:
[email protected].6, prop-types@^15.5.2, prop-types@~15.5.0:
version "15.5.6"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.6.tgz#797a915b1714b645ebb7c5d6cc690346205bd2aa"
dependencies:
Expand Down

0 comments on commit e0f71d8

Please sign in to comment.