Skip to content

Commit

Permalink
Support async/await (#327)
Browse files Browse the repository at this point in the history
* Make Babel config more verbose and simpler

* Support async/await
  • Loading branch information
gaearon authored Aug 2, 2016
1 parent 0e5abad commit fa38991
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
18 changes: 9 additions & 9 deletions config/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ module.exports = {
babelrc: false,
cacheDirectory: true,
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-react'
].map(require.resolve),
require.resolve('babel-preset-es2015'),
require.resolve('babel-preset-es2016'),
require.resolve('babel-preset-react')
],
plugins: [
'babel-plugin-syntax-trailing-function-commas',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-object-rest-spread'
].map(require.resolve).concat([
require.resolve('babel-plugin-syntax-trailing-function-commas'),
require.resolve('babel-plugin-transform-async-to-generator'),
require.resolve('babel-plugin-transform-class-properties'),
require.resolve('babel-plugin-transform-object-rest-spread'),
[require.resolve('babel-plugin-transform-runtime'), {
helpers: false,
polyfill: false,
regenerator: true
}]
])
]
};
20 changes: 10 additions & 10 deletions config/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
module.exports = {
babelrc: false,
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-react'
].map(require.resolve),
require.resolve('babel-preset-es2015'),
require.resolve('babel-preset-es2016'),
require.resolve('babel-preset-react')
],
plugins: [
'babel-plugin-syntax-trailing-function-commas',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-react-constant-elements',
].map(require.resolve).concat([
require.resolve('babel-plugin-syntax-trailing-function-commas'),
require.resolve('babel-plugin-transform-async-to-generator'),
require.resolve('babel-plugin-transform-class-properties'),
require.resolve('babel-plugin-transform-object-rest-spread'),
require.resolve('babel-plugin-transform-react-constant-elements'),
[require.resolve('babel-plugin-transform-runtime'), {
helpers: false,
polyfill: false,
regenerator: true
}]
])
]
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"babel-jest": "14.1.0",
"babel-loader": "6.2.4",
"babel-plugin-syntax-trailing-function-commas": "6.8.0",
"babel-plugin-transform-async-to-generator": "6.8.0",
"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",
Expand Down

0 comments on commit fa38991

Please sign in to comment.