Skip to content

Commit ae0042c

Browse files
il3vennovemberborn
andauthored
Update Babel recipe for AVA 4
Co-authored-by: Mark Wubben <[email protected]>
1 parent f8be152 commit ae0042c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/recipes/babel.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
# Configuring Babel with AVA 3
1+
# Configuring Babel with AVA
22

33
Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/babel.md)
44

5-
**This is no longer available in AVA 4.**
6-
7-
You can enable Babel support by installing `@ava/babel`, and then in AVA's configuration setting `babel` to `true`:
5+
You can enable Babel support by installing [`@babel/register`](https://babeljs.io/docs/en/babel-register) and `@babel/core`, and then in AVA's configuration requiring `@babel/register`:
86

97
**`package.json`:**
108

119
```json
1210
{
1311
"ava": {
14-
"babel": true
12+
"require": [
13+
"@babel/register"
14+
]
1515
}
1616
}
1717
```
1818

19-
Find out more in [`@ava/babel`](https://github.com/avajs/babel).
19+
`@babel/register` is compatible with CommonJS only. It intercepts `require()` calls and compiles files on the fly. This will compile source, helper and test files.
20+
21+
For more information visit the [Babel documentation](https://babeljs.io/docs/en/babel-register).

0 commit comments

Comments
 (0)