Skip to content
Prev Previous commit
Next Next commit
update docs
  • Loading branch information
GeoffreyBooth committed Mar 11, 2024
commit b1c17bbca60241c9c19d681f91f216a7a1800826
14 changes: 10 additions & 4 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ added:
- v20.10.0
-->

> Stability: 1.0 - Early development
> Stability: 1.1 - Active development

Node.js will inspect the source code of ambiguous input to determine whether it
contains ES module syntax; if such syntax is detected, the input will be treated
Expand All @@ -792,9 +792,15 @@ Ambiguous input is defined as:
`--experimental-default-type` are specified.

ES module syntax is defined as syntax that would throw when evaluated as
CommonJS. This includes `import` and `export` statements and `import.meta`
references. It does _not_ include `import()` expressions, which are valid in
CommonJS.
CommonJS. This includes the following:

* `import` statements (but _not_ `import()` expressions, which are valid in
CommonJS).
* `export` statements.
* `import.meta` references.
* `await` at the top level of a module.
* `const` declarations of the CommonJS wrapper variables (`require`, `module`,
Comment thread
GeoffreyBooth marked this conversation as resolved.
Outdated
`exports`, `__dirname`, `__filename`).

### `--experimental-import-meta-resolve`

Expand Down