mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
doc: spell out condition restrictions
PR-URL: https://github.com/nodejs/node/pull/55187 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
fa8f149c0a
commit
73414f34e8
@ -755,6 +755,20 @@ exports, while resolving the existing `"node"`, `"node-addons"`, `"default"`,
|
|||||||
|
|
||||||
Any number of custom conditions can be set with repeat flags.
|
Any number of custom conditions can be set with repeat flags.
|
||||||
|
|
||||||
|
Typical conditions should only contain alphanumerical characters,
|
||||||
|
using ":", "-", or "=" as separators if necessary. Anything else may run
|
||||||
|
into compability issues outside of node.
|
||||||
|
|
||||||
|
In node, conditions have very few restrictions, but specifically these include:
|
||||||
|
|
||||||
|
1. They must contain at least one character.
|
||||||
|
2. They cannot start with "." since they may appear in places that also
|
||||||
|
allow relative paths.
|
||||||
|
3. They cannot contain "," since they may be parsed as a comma-separated
|
||||||
|
list by some CLI tools.
|
||||||
|
4. They cannot be integer property keys like "10" since that can have
|
||||||
|
unexpected effects on property key ordering for JS objects.
|
||||||
|
|
||||||
### Community Conditions Definitions
|
### Community Conditions Definitions
|
||||||
|
|
||||||
Condition strings other than the `"import"`, `"require"`, `"node"`, `"module-sync"`,
|
Condition strings other than the `"import"`, `"require"`, `"node"`, `"module-sync"`,
|
||||||
|
Loading…
Reference in New Issue
Block a user