You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/recipes/babelrc.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ There are multiple options for configuring how AVA transpiles your tests using B
14
14
15
15
## AVA's default transpiler behavior
16
16
17
-
By default, AVA transpiles your tests (and only your tests) using the [`es2015`](http://babeljs.io/docs/plugins/preset-es2015/) and [`stage-2`](http://babeljs.io/docs/plugins/preset-stage-2/) Babel presets. This is a great option for small modules where you do not desire a build step to transpile your source before deploying to `npm`.
17
+
By default, AVA transpiles your tests (and only your tests) using the [`es2015-node4`](https://github.com/jbach/babel-preset-es2015-node4) on Node.js 4 or [`node6`](https://github.com/salakar/babel-preset-node6) on Node.js 6 and higher, and [`stage-2`](http://babeljs.io/docs/plugins/preset-stage-2/) Babel presets. This is a great option for small modules where you do not desire a build step to transpile your source before deploying to `npm`.
18
18
19
19
## Customizing how AVA transpiles your tests
20
20
@@ -25,7 +25,7 @@ You can override the default Babel configuration AVA uses for test transpilation
25
25
"ava": {
26
26
"babel": {
27
27
"plugins": ["rewire"],
28
-
"presets": ["es2015", "stage-3"]
28
+
"presets": ["es2015-node4", "stage-3"]
29
29
}
30
30
}
31
31
}
@@ -43,7 +43,7 @@ To transpile your sources, you will need to define a [`babel config` ](http://ba
43
43
"require": ["babel-register"]
44
44
},
45
45
"babel": {
46
-
"presets": ["es2015"]
46
+
"presets": ["es2015-node4"]
47
47
}
48
48
}
49
49
```
@@ -63,12 +63,12 @@ Using the `"inherit"` shortcut will cause your tests to be transpiled the same a
63
63
"babel": "inherit"
64
64
},
65
65
"babel": {
66
-
"presets": ["es2015", "react"]
66
+
"presets": ["es2015-node4", "react"]
67
67
}
68
68
}
69
69
```
70
70
71
-
In the above example, both tests and sources will be transpiled using the [`es2015`](http://babeljs.io/docs/plugins/preset-es2015/) and [`react`](http://babeljs.io/docs/plugins/preset-react/) presets.
71
+
In the above example, both tests and sources will be transpiled using the [`es2015-node4`](https://github.com/jbach/babel-preset-es2015-node4) and [`react`](http://babeljs.io/docs/plugins/preset-react/) presets.
72
72
73
73
## Extend your source transpilation configuration
74
74
@@ -87,12 +87,12 @@ When specifying the Babel config for your tests, you can set the `babelrc` optio
87
87
}
88
88
},
89
89
"babel": {
90
-
"presets": ["es2015", "react"]
90
+
"presets": ["es2015-node4", "react"]
91
91
}
92
92
}
93
93
```
94
94
95
-
In the above example, *sources* are compiled use [`es2015`](http://babeljs.io/docs/plugins/preset-es2015/) and [`react`](http://babeljs.io/docs/plugins/preset-react/), *tests* use those same plugins, plus the additional `custom` plugins specified.
95
+
In the above example, *sources* are compiled use [`es2015-node4`](https://github.com/jbach/babel-preset-es2015-node4) and [`react`](http://babeljs.io/docs/plugins/preset-react/), *tests* use those same plugins, plus the additional `custom` plugins specified.
0 commit comments