Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
feat: use babel-preset-env for browser (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau authored Mar 9, 2017
1 parent a2fc681 commit 73bff30
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 90 deletions.
9 changes: 6 additions & 3 deletions config/build/babelrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import presetLatest from 'babel-preset-latest';
import presetEnv from 'babel-preset-env';
import presetReact from 'babel-preset-react';
import presetStage1 from 'babel-preset-stage-1';
Expand All @@ -16,8 +15,12 @@ import { vitaminResolve } from '../utils';
export default (env, dev) => ({
// order is: last to first
presets: [
env === 'client' ? [presetLatest, { es2015: { modules: false } }]
: [presetEnv, { modules: false, targets: { node: 'current' }, useBuiltIns: true }],
[presetEnv, {
modules: false,
useBuiltIns: true,
targets: env !== 'client' ? { node: 'current' }
: { uglify: !dev, browsers: ['not ie < 9'] },
}],
presetReact,
presetStage1,
].filter(Boolean),
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"babel-plugin-transform-node-env-inline": "^6.8.0",
"babel-plugin-transform-react-jsx-self": "^6.22.0",
"babel-plugin-transform-react-jsx-source": "^6.22.0",
"babel-preset-env": "^1.1.11",
"babel-preset-latest": "^6.22.0",
"babel-preset-env": "^1.2.1",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"babel-register": "^6.23.0",
Expand Down
120 changes: 35 additions & 85 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ babel-helper-hoist-variables@^6.22.0:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-helper-mark-eval-scopes@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.0.2.tgz#909fd1f2384570cd3003283773852d9d63922a37"
babel-helper-mark-eval-scopes@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.0.3.tgz#902f75aeb537336edc35eb9f52b6f09db7785328"

babel-helper-optimise-call-expression@^6.23.0:
version "6.23.0"
Expand Down Expand Up @@ -447,7 +447,7 @@ babel-messages@^6.23.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-check-es2015-constants@^6.22.0, babel-plugin-check-es2015-constants@^6.3.13:
babel-plugin-check-es2015-constants@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
dependencies:
Expand All @@ -457,11 +457,11 @@ babel-plugin-discard-module-references@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-discard-module-references/-/babel-plugin-discard-module-references-1.1.2.tgz#898007cbeb472cef76ef11e1af485b41d4241747"

babel-plugin-minify-dead-code-elimination@0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.3.tgz#7882c014619934cb9aca69d85c968ed124ac97e3"
babel-plugin-minify-dead-code-elimination@0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.4.tgz#18b6ecfab77c29caca061d8210fa3495001e4fa1"
dependencies:
babel-helper-mark-eval-scopes "^0.0.2"
babel-helper-mark-eval-scopes "^0.0.3"
babel-helper-remove-or-void "^0.0.1"
lodash.some "^4.6.0"

Expand All @@ -471,9 +471,9 @@ babel-plugin-minify-guarded-expressions@0.0.4:
dependencies:
babel-helper-flip-expressions "^0.0.2"

babel-plugin-minify-replace@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.3.tgz#4a623336c0a3b4de4dedba0a80fdb6b5935f024f"
babel-plugin-minify-replace@0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.4.tgz#d8d8a977abec403125575976afdf182e712ed570"

babel-plugin-react-require@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -570,19 +570,19 @@ babel-plugin-transform-decorators@^6.22.0:
babel-template "^6.22.0"
babel-types "^6.22.0"

babel-plugin-transform-es2015-arrow-functions@^6.22.0, babel-plugin-transform-es2015-arrow-functions@^6.3.13:
babel-plugin-transform-es2015-arrow-functions@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoped-functions@^6.22.0, babel-plugin-transform-es2015-block-scoped-functions@^6.3.13:
babel-plugin-transform-es2015-block-scoped-functions@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoping@^6.22.0, babel-plugin-transform-es2015-block-scoping@^6.6.0:
babel-plugin-transform-es2015-block-scoping@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51"
dependencies:
Expand All @@ -592,7 +592,7 @@ babel-plugin-transform-es2015-block-scoping@^6.22.0, babel-plugin-transform-es20
babel-types "^6.23.0"
lodash "^4.2.0"

babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.6.0:
babel-plugin-transform-es2015-classes@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1"
dependencies:
Expand All @@ -606,41 +606,41 @@ babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-cla
babel-traverse "^6.23.0"
babel-types "^6.23.0"

babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.3.13:
babel-plugin-transform-es2015-computed-properties@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.22.0"

babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.6.0:
babel-plugin-transform-es2015-destructuring@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.6.0:
babel-plugin-transform-es2015-duplicate-keys@^6.6.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b"
dependencies:
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.6.0:
babel-plugin-transform-es2015-for-of@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.3.13:
babel-plugin-transform-es2015-function-name@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104"
dependencies:
babel-helper-function-name "^6.22.0"
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-plugin-transform-es2015-literals@^6.22.0, babel-plugin-transform-es2015-literals@^6.3.13:
babel-plugin-transform-es2015-literals@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e"
dependencies:
Expand All @@ -663,30 +663,30 @@ babel-plugin-transform-es2015-modules-commonjs@^6.22.0, babel-plugin-transform-e
babel-template "^6.23.0"
babel-types "^6.23.0"

babel-plugin-transform-es2015-modules-systemjs@^6.12.0, babel-plugin-transform-es2015-modules-systemjs@^6.22.0:
babel-plugin-transform-es2015-modules-systemjs@^6.12.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/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.12.0, babel-plugin-transform-es2015-modules-umd@^6.22.0:
babel-plugin-transform-es2015-modules-umd@^6.12.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz#8d284ae2e19ed8fe21d2b1b26d6e7e0fcd94f0f1"
dependencies:
babel-plugin-transform-es2015-modules-amd "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"

babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.3.13:
babel-plugin-transform-es2015-object-super@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc"
dependencies:
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.6.0:
babel-plugin-transform-es2015-parameters@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b"
dependencies:
Expand All @@ -697,40 +697,40 @@ babel-plugin-transform-es2015-parameters@^6.22.0, babel-plugin-transform-es2015-
babel-traverse "^6.23.0"
babel-types "^6.23.0"

babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.3.13:
babel-plugin-transform-es2015-shorthand-properties@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-plugin-transform-es2015-spread@^6.22.0, babel-plugin-transform-es2015-spread@^6.3.13:
babel-plugin-transform-es2015-spread@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.3.13:
babel-plugin-transform-es2015-sticky-regex@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593"
dependencies:
babel-helper-regex "^6.22.0"
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-plugin-transform-es2015-template-literals@^6.22.0, babel-plugin-transform-es2015-template-literals@^6.6.0:
babel-plugin-transform-es2015-template-literals@^6.6.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.6.0:
babel-plugin-transform-es2015-typeof-symbol@^6.6.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.3.13:
babel-plugin-transform-es2015-unicode-regex@^6.3.13:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20"
dependencies:
Expand Down Expand Up @@ -807,7 +807,7 @@ babel-plugin-transform-react-jsx@^6.23.0:
babel-plugin-syntax-jsx "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.6.0:
babel-plugin-transform-regenerator@^6.6.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6"
dependencies:
Expand All @@ -820,9 +820,9 @@ babel-plugin-transform-strict-mode@^6.22.0:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

babel-preset-env@^1.1.11:
version "1.1.11"
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.1.11.tgz#6aac8fc470ed2b38872f0b45b558e41125ea48a9"
babel-preset-env@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.2.1.tgz#659178f54df74a74765f796be4d290b5beeb3f5f"
dependencies:
babel-plugin-check-es2015-constants "^6.3.13"
babel-plugin-syntax-trailing-function-commas "^6.13.0"
Expand Down Expand Up @@ -855,62 +855,12 @@ babel-preset-env@^1.1.11:
electron-to-chromium "^1.1.0"
invariant "^2.2.2"

babel-preset-es2015@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835"
dependencies:
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.22.0"
babel-plugin-transform-es2015-classes "^6.22.0"
babel-plugin-transform-es2015-computed-properties "^6.22.0"
babel-plugin-transform-es2015-destructuring "^6.22.0"
babel-plugin-transform-es2015-duplicate-keys "^6.22.0"
babel-plugin-transform-es2015-for-of "^6.22.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.22.0"
babel-plugin-transform-es2015-modules-systemjs "^6.22.0"
babel-plugin-transform-es2015-modules-umd "^6.22.0"
babel-plugin-transform-es2015-object-super "^6.22.0"
babel-plugin-transform-es2015-parameters "^6.22.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.22.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.yarnpkg.com/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.yarnpkg.com/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.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d"
dependencies:
babel-plugin-transform-flow-strip-types "^6.22.0"

babel-preset-latest@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.22.0.tgz#47b800531350a3dc69126e8c375a40655cd1eeff"
dependencies:
babel-preset-es2015 "^6.22.0"
babel-preset-es2016 "^6.22.0"
babel-preset-es2017 "^6.22.0"

babel-preset-react@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.23.0.tgz#eb7cee4de98a3f94502c28565332da9819455195"
Expand Down

0 comments on commit 73bff30

Please sign in to comment.