Skip to content

Commit

Permalink
doc: clarify require/import mutual exclusivity
Browse files Browse the repository at this point in the history
PR-URL: #33832
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
  • Loading branch information
guybedford committed Jun 28, 2020
1 parent f63436d commit f89530f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,10 @@ Node.js supports the following conditions:
* `"import"` - matched when the package is loaded via `import` or
`import()`. Can reference either an ES module or CommonJS file, as both
`import` and `import()` can load either ES module or CommonJS sources.
_Always matched when the `"require"` condition is not matched._
* `"require"` - matched when the package is loaded via `require()`.
As `require()` only supports CommonJS, the referenced file must be CommonJS.
_Always matched when the `"import"` condition is not matched._
* `"node"` - matched for any Node.js environment. Can be a CommonJS or ES
module file. _This condition should always come after `"import"` or
`"require"`._
Expand Down

0 comments on commit f89530f

Please sign in to comment.