Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove resolver references from condition definitions
  • Loading branch information
guybedford committed Dec 10, 2019
commit 1fe09b1b1142ae6fe088144418fb0f329ffbee25
16 changes: 7 additions & 9 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,14 @@ The conditions supported in Node.js are matched in the following order:

1. `"node"` - matched for any Node.js environment. Can be a CommonJS or ES
module file. _This is currently only supported behind the
`--experimental-conditional-exports` flag._
2. `"require"` - matched when the package is loaded with the CommonJS
module resolver such as via `require()`.
_This is currently only supported behind the
`--experimental-conditional-exports` flag._
3. `"import"` - matched when the package is imported with the ES module
resolver such as when using a static or dynamic import expression.
Can be any module format, this field does not set the type interpretation.
`--experimental-conditional-exports` flag._
2. `"require"` - matched when the package is loaded via `require()`.
_This is currently only supported behind the
`--experimental-conditional-exports` flag._
`--experimental-conditional-exports` flag._
3. `"import"` - matched when the package is loaded via `import` or
`import()`. Can be any module format, this field does not set the type
interpretation. _This is currently only supported behind the
`--experimental-conditional-exports` flag._
Comment thread
guybedford marked this conversation as resolved.
Outdated

Using the `"require"` condition it is possible to define a package that will
have a different exported value for CommonJS and ES modules, which can be a
Expand Down