Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0230fb1

Browse filesBrowse files
hybristruyadorno
authored andcommitted
doc: spell out condition restrictions
PR-URL: #55187 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent f41d329 commit 0230fb1
Copy full SHA for 0230fb1

1 file changed

+14Lines changed: 14 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/packages.md‎

Copy file name to clipboardExpand all lines: doc/api/packages.md
+14Lines changed: 14 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,20 @@ exports, while resolving the existing `"node"`, `"node-addons"`, `"default"`,
755755

756756
Any number of custom conditions can be set with repeat flags.
757757

758+
Typical conditions should only contain alphanumerical characters,
759+
using ":", "-", or "=" as separators if necessary. Anything else may run
760+
into compability issues outside of node.
761+
762+
In node, conditions have very few restrictions, but specifically these include:
763+
764+
1. They must contain at least one character.
765+
2. They cannot start with "." since they may appear in places that also
766+
allow relative paths.
767+
3. They cannot contain "," since they may be parsed as a comma-separated
768+
list by some CLI tools.
769+
4. They cannot be integer property keys like "10" since that can have
770+
unexpected effects on property key ordering for JS objects.
771+
758772
### Community Conditions Definitions
759773

760774
Condition strings other than the `"import"`, `"require"`, `"node"`, `"module-sync"`,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.