Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Revert refine conditions constraints PR #35357

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,12 @@ For example, a package that wants to provide different ES module exports for
Node.js supports the following conditions out of the box:

* `"import"` - matched when the package is loaded via `import` or
`import()`, or via any top-level import or resolve operation by the
ECMAScript module loader. Applies regardless of the module format of the
target file. _Always mutually exclusive with `"require"`._
* `"require"` - matched when the package is loaded via `require()`. The
referenced file should be loadable with `require()` although the condition
will be matched regardless of the module format of the target file. Expected
formats include CommonJS, JSON, and native addons but not ES modules as
`require()` doesn't support them. _Always mutually exclusive with
`"import"`._
`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