diff options
author | Guy Bedford <guybedford@gmail.com> | 2020-08-05 22:06:28 +0300 |
---|---|---|
committer | Guy Bedford <guybedford@gmail.com> | 2020-08-12 00:35:44 +0300 |
commit | 77a515c31aa4383e54e032bebdc399b3704e8a3d (patch) | |
tree | 7d9c73a93ab4314b1121ce4a62c17a408a7625e1 /doc/api/esm.md | |
parent | 420da0ccd195adfd36bf160d59af92567a8df74f (diff) |
module: custom --conditions flag option
PR-URL: https://github.com/nodejs/node/pull/34637
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Diffstat (limited to 'doc/api/esm.md')
-rw-r--r-- | doc/api/esm.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md index 551eef604ea..adbb55f0d82 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -501,6 +501,21 @@ a nested conditional does not have any mapping it will continue checking the remaining conditions of the parent condition. In this way nested conditions behave analogously to nested JavaScript `if` statements. +#### Resolving user conditions + +When running Node.js, custom user conditions can be added with the +`--conditions` or `-u` flag: + +```bash +node --conditions=development main.js +``` + +which would then resolve the `"development"` condition in package imports and +exports, while resolving the existing `"node"`, `"default"`, `"import"`, and +`"require"` conditions as appropriate. + +Any number of custom conditions can be set with repeat flags. + #### Self-referencing a package using its name Within a package, the values defined in the package’s |