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
rewording
  • Loading branch information
guybedford committed Jul 13, 2020
commit d7f1f4ee79cd081d58a25339d067bb9d3a5fe1d9
14 changes: 7 additions & 7 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,13 @@ Defines a package where `require('pkg/feature')` and `import 'pkg/feature'`
could provide different implementations between Node.js and other JS
environments.

When using environment branches, include
a `"defaut"` condition where possible. Always providing a `"default"` condition
ensures that any unknown JS environments are able to use a universal
implementation where possible, which helps avoid JS environments from having to
pretend to be existing environments to support packages with conditional
exports. Where possible, `"node"` and `"default"` conditions can be preferable
to `"browser"` conditions.
When using environment branches, always include a `"default"` condition where
possible. Providing a `"default"` condition ensures that any unknown JS
environments are able to use this universal implementation, which helps avoid
these JS environments from having to pretend to be existing environments in
order to support packages with conditional exports. For this reason, using
`"node"` and `"default"` condition branches is usually preferable to using
`"node"` and `"browser"` condition branches.

#### Nested conditions

Expand Down