Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Bedford <guybedford@gmail.com>2020-06-11 00:01:02 +0300
committerGuy Bedford <guybedford@gmail.com>2020-06-28 07:18:54 +0300
commitf89530fccc9a2420cef58861aaafa9732683e154 (patch)
tree009d6abc294d9c224e5db56363f2f4064603edb3 /doc/api/esm.md
parentf63436d190b60e12131036aa9d1888d9023e9127 (diff)
doc: clarify require/import mutual exclusivity
PR-URL: https://github.com/nodejs/node/pull/33832 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Diffstat (limited to 'doc/api/esm.md')
-rw-r--r--doc/api/esm.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md
index 9252eaeed23..eca866e452b 100644
--- a/doc/api/esm.md
+++ b/doc/api/esm.md
@@ -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"`._