Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mark Wubben <mark@novemberborn.net>
- Loading branch information
1 parent
f8be152
commit ae0042c
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
# Configuring Babel with AVA 3 | ||
# Configuring Babel with AVA | ||
|
||
Translations: [Fran莽ais](https://github.com/avajs/ava-docs/blob/master/fr_FR/docs/recipes/babel.md) | ||
|
||
**This is no longer available in AVA 4.** | ||
|
||
You can enable Babel support by installing `@ava/babel`, and then in AVA's configuration setting `babel` to `true`: | ||
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`: | ||
|
||
**`package.json`:** | ||
|
||
```json | ||
{ | ||
"ava": { | ||
"babel": true | ||
"require": [ | ||
"@babel/register" | ||
] | ||
} | ||
} | ||
``` | ||
|
||
Find out more in [`@ava/babel`](https://github.com/avajs/babel). | ||
`@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. | ||
|
||
For more information visit the [Babel documentation](https://babeljs.io/docs/en/babel-register). |