Skip to content

Commit

Permalink
Started using babel-preset-latest (facebook#490)
Browse files Browse the repository at this point in the history
* Started using babel-preset-latest

* Updated babel dependencies

* Remove redundant babel-plugin-syntax-async-functions

* Disabled redundant regenerator transform
  • Loading branch information
kripod authored and George Czabania committed Sep 7, 2016
1 parent 8255d9d commit 68e8d2c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
15 changes: 6 additions & 9 deletions config/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@ module.exports = {
// It enables caching results in OS temporary directory for faster rebuilds.
cacheDirectory: true,
presets: [
// let, const, destructuring, classes, modules
require.resolve('babel-preset-es2015'),
// exponentiation
require.resolve('babel-preset-es2016'),
// Latest stable ECMAScript features
require.resolve('babel-preset-latest'),
// JSX, Flow
require.resolve('babel-preset-react')
],
plugins: [
// function x(a, b, c,) { }
require.resolve('babel-plugin-syntax-trailing-function-commas'),
// await fetch()
require.resolve('babel-plugin-syntax-async-functions'),
// class { handleClick = () => { } }
require.resolve('babel-plugin-transform-class-properties'),
// { ...todo, completed: true }
require.resolve('babel-plugin-transform-object-rest-spread'),
// function* () { yield 42; yield 43; }
require.resolve('babel-plugin-transform-regenerator'),
[require.resolve('babel-plugin-transform-regenerator'), {
// Async functions are converted to generators by babel-preset-latest
async: false
}],
// Polyfills the runtime needed for async/await and generators
[require.resolve('babel-plugin-transform-runtime'), {
helpers: false,
Expand Down
15 changes: 6 additions & 9 deletions config/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,21 @@ module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
presets: [
// let, const, destructuring, classes, modules
require.resolve('babel-preset-es2015'),
// exponentiation
require.resolve('babel-preset-es2016'),
// Latest stable ECMAScript features
require.resolve('babel-preset-latest'),
// JSX, Flow
require.resolve('babel-preset-react')
],
plugins: [
// function x(a, b, c,) { }
require.resolve('babel-plugin-syntax-trailing-function-commas'),
// await fetch()
require.resolve('babel-plugin-syntax-async-functions'),
// class { handleClick = () => { } }
require.resolve('babel-plugin-transform-class-properties'),
// { ...todo, completed: true }
require.resolve('babel-plugin-transform-object-rest-spread'),
// function* () { yield 42; yield 43; }
require.resolve('babel-plugin-transform-regenerator'),
[require.resolve('babel-plugin-transform-regenerator'), {
// Async functions are converted to generators by babel-preset-latest
async: false
}],
// Polyfills the runtime needed for async/await and generators
[require.resolve('babel-plugin-transform-runtime'), {
helpers: false,
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@
},
"dependencies": {
"autoprefixer": "6.4.0",
"babel-core": "6.11.4",
"babel-core": "6.14.0",
"babel-eslint": "6.1.2",
"babel-jest": "14.1.0",
"babel-loader": "6.2.4",
"babel-plugin-syntax-async-functions": "6.8.0",
"babel-plugin-syntax-trailing-function-commas": "6.8.0",
"babel-loader": "6.2.5",
"babel-plugin-transform-class-properties": "6.11.5",
"babel-plugin-transform-object-rest-spread": "6.8.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-regenerator": "6.11.4",
"babel-plugin-transform-regenerator": "6.14.0",
"babel-plugin-transform-runtime": "6.12.0",
"babel-preset-es2015": "6.9.0",
"babel-preset-es2016": "6.11.3",
"babel-preset-latest": "6.14.0",
"babel-preset-react": "6.11.1",
"babel-runtime": "6.11.6",
"case-sensitive-paths-webpack-plugin": "1.1.3",
Expand Down

0 comments on commit 68e8d2c

Please sign in to comment.