From 4b671474b3b324f62608ac7616a6aacca4f1dfea Mon Sep 17 00:00:00 2001 From: il3ven Date: Mon, 4 Apr 2022 01:19:46 +0530 Subject: [PATCH 1/2] update babel recepie for AVA 4 We now recommend `@babel/register` instead of `@ava/babel`. --- docs/recipes/babel.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/recipes/babel.md b/docs/recipes/babel.md index 32f6da8b1..9c67aa249 100644 --- a/docs/recipes/babel.md +++ b/docs/recipes/babel.md @@ -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` binds itself to the node's require hook and automatically compiles files on the fly.This will compile both the source and the test files. + +For more information visit the [Babel docs](https://babeljs.io/docs/en/babel-register). From 3000009a562f671e39a7218c25cf5a12e2b2c2fc Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Mon, 4 Apr 2022 17:02:40 +0200 Subject: [PATCH 2/2] Tweaks --- docs/recipes/babel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/recipes/babel.md b/docs/recipes/babel.md index 9c67aa249..d903619e2 100644 --- a/docs/recipes/babel.md +++ b/docs/recipes/babel.md @@ -16,6 +16,6 @@ You can enable Babel support by installing [`@babel/register`](https://babeljs.i } ``` -`@babel/register` binds itself to the node's require hook and automatically compiles files on the fly.This will compile both the source and the test files. +`@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 docs](https://babeljs.io/docs/en/babel-register). +For more information visit the [Babel documentation](https://babeljs.io/docs/en/babel-register).