Skip to content

Commit d8704aa

Browse files
committed
doc: spell out condition restrictions
1 parent a67cb6c commit d8704aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/api/packages.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,17 @@ exports, while resolving the existing `"node"`, `"node-addons"`, `"default"`,
689689

690690
Any number of custom conditions can be set with repeat flags.
691691

692+
Conditions can be almost any string, including multi-byte characters and
693+
whitespace. There's only a few restrictions:
694+
695+
1. They must contain at least one character.
696+
1. They cannot start with "." since they may appear in places that also
697+
allow relative paths.
698+
1. They cannot contain "," since they may be parsed as a comma-separated
699+
list by some CLI tools.
700+
1. They cannot be numeric property keys like "10" since that can have
701+
unexpected effects on property ordering.
702+
692703
### Community Conditions Definitions
693704

694705
Condition strings other than the `"import"`, `"require"`, `"node"`,

0 commit comments

Comments
 (0)