Skip to content

Commit 66cd7bf

Browse files
guybedfordaddaleax
authored andcommitted
doc: clarify require/import mutual exclusivity
PR-URL: #33832 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]>
1 parent 5ba0ba4 commit 66cd7bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/esm.md

+2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,10 @@ Node.js supports the following conditions:
424424
* `"import"` - matched when the package is loaded via `import` or
425425
`import()`. Can reference either an ES module or CommonJS file, as both
426426
`import` and `import()` can load either ES module or CommonJS sources.
427+
_Always matched when the `"require"` condition is not matched._
427428
* `"require"` - matched when the package is loaded via `require()`.
428429
As `require()` only supports CommonJS, the referenced file must be CommonJS.
430+
_Always matched when the `"import"` condition is not matched._
429431
* `"node"` - matched for any Node.js environment. Can be a CommonJS or ES
430432
module file. _This condition should always come after `"import"` or
431433
`"require"`._

0 commit comments

Comments
 (0)