parent
23903e7ef4
commit
a1cdbdafcf
4 changed files with 10 additions and 12 deletions
13
Readme.md
13
Readme.md
|
@ -119,22 +119,21 @@ app.use(convert(function *(next) {
|
|||
```
|
||||
|
||||
## Babel setup
|
||||
For Node 4.0 and Babel 6.0 you can setup like this
|
||||
|
||||
For Node 4.0 and Babel 6.0 you can setup like this:
|
||||
|
||||
```bash
|
||||
// install babel and required presets
|
||||
$ npm install babel-core --save
|
||||
$ npm install babel-preset-es2015-node5 --save
|
||||
$ npm install babel-preset-stage-3 --save
|
||||
$ npm install babel-register transform-async-to-generator --save
|
||||
```
|
||||
|
||||
```js
|
||||
// set babel in entry file
|
||||
require('babel-core/register')({
|
||||
presets: ['es2015-node5', 'stage-3']
|
||||
require('babel-register')({
|
||||
plugins: ['transform-async-to-generator']
|
||||
});
|
||||
```
|
||||
|
||||
Check out an example in koa's [test](test/babel/index.js).
|
||||
|
||||
## Running tests
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@
|
|||
"tag": "next"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.1.2",
|
||||
"babel-eslint": "^6.0.0",
|
||||
"babel-plugin-transform-async-to-generator": "^6.0.14",
|
||||
"babel-register": "^6.9.0",
|
||||
"eslint": "^2.5.3",
|
||||
"eslint-config-standard": "^5.1.0",
|
||||
"eslint-plugin-babel": "^3.1.0",
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"plugins": ["transform-async-to-generator"]
|
||||
}
|
|
@ -2,5 +2,7 @@
|
|||
|
||||
// http://babeljs.io/docs/setup/#babel_register
|
||||
|
||||
require('babel-core/register');
|
||||
require('babel-register')({
|
||||
plugins: ['transform-async-to-generator']
|
||||
});
|
||||
require('./_test.js');
|
||||
|
|
Loading…
Reference in a new issue