File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -364,12 +364,15 @@ For example, a package that wants to provide different ES module exports for
364364Node.js supports the following conditions out of the box:
365365
366366* ` "import" ` - matched when the package is loaded via ` import ` or
367- ` import() ` . Can reference either an ES module or CommonJS file, as both
368- ` import ` and ` import() ` can load either ES module or CommonJS sources.
369- _ Always matched when the ` "require" ` condition is not matched._
370- * ` "require" ` - matched when the package is loaded via ` require() ` .
371- As ` require() ` only supports CommonJS, the referenced file must be CommonJS.
372- _ Always matched when the ` "import" ` condition is not matched._
367+ ` import() ` , or via any top-level import or resolve operation by the
368+ ECMAScript module loader. Applies regardless of the module format of the
369+ target file. _ Always mutually exclusive with ` "require" ` ._
370+ * ` "require" ` - matched when the package is loaded via ` require() ` . The
371+ referenced file should be loadable with ` require() ` although the condition
372+ will be matched regardless of the module format of the target file. Expected
373+ formats include CommonJS, JSON, and native addons but not ES modules as
374+ ` require() ` doesn't support them. _ Always mutually exclusive with
375+ ` "import" ` ._
373376* ` "node" ` - matched for any Node.js environment. Can be a CommonJS or ES
374377 module file. _ This condition should always come after ` "import" ` or
375378 ` "require" ` ._
You can’t perform that action at this time.
0 commit comments