Skip to content

Commit 5b76b0b

Browse files
committed
ES Modules are no longer experimental since Node.js 12.17
1 parent a7faa3e commit 5b76b0b

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

docs/recipes/es-modules.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,7 @@
22

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

5-
As of Node.js 13, [ECMAScript Modules](https://nodejs.org/docs/latest/api/esm.html#esm_introduction) are natively supported in Node.js itself. AVA 3.3 supports ESM test files, however support is incomplete. The [ESM support project](https://github.com/orgs/avajs/projects/2) tracks our progress.
6-
7-
ESM support in Node.js is experimental, though enabled by default in Node.js 13. *You will see messages like `ExperimentalWarning: The ESM module loader is experimental` in AVA's output. These are emitted by Node.js, not AVA.*
8-
9-
## Enabling experimental ESM support in Node.js 12
10-
11-
In Node.js 12 you need to enable ESM support. You can do so via AVA by configuring `nodeArguments` in your `package.json` or `ava.config.*` file:
12-
13-
**`package.json`:**
14-
15-
```json
16-
{
17-
"ava": {
18-
"nodeArguments": [
19-
"--experimental-modules"
20-
]
21-
}
22-
}
23-
```
24-
25-
Or on the command line:
26-
27-
```console
28-
npx ava --node-arguments '--experimental-modules' test.mjs
29-
```
5+
As of Node.js 12.17, [ECMAScript Modules](https://nodejs.org/docs/latest/api/esm.html#esm_introduction) are natively supported in Node.js itself. AVA 3.3 supports ESM test files, however support is incomplete. The [ESM support project](https://github.com/orgs/avajs/projects/2) tracks our progress.
306

317
## Using the `esm` package
328

0 commit comments

Comments
 (0)