Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 66cd7bf

Browse filesBrowse files
guybedfordaddaleax
authored andcommitted
doc: clarify require/import mutual exclusivity
PR-URL: #33832 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
1 parent 5ba0ba4 commit 66cd7bf
Copy full SHA for 66cd7bf

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.