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 /src | |
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 'src')
-rw-r--r-- | src/node_options.cc | 5 | ||||
-rw-r--r-- | src/node_options.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/node_options.cc b/src/node_options.cc index 737c4c147d3..d3fdc459de1 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -281,6 +281,11 @@ DebugOptionsParser::DebugOptionsParser() { } EnvironmentOptionsParser::EnvironmentOptionsParser() { + AddOption("--conditions", + "additional user conditions for conditional exports and imports", + &EnvironmentOptions::conditions, + kAllowedInEnvironment); + AddAlias("-u", "--conditions"); AddOption("--diagnostic-dir", "set dir for all output files" " (default: current working directory)", diff --git a/src/node_options.h b/src/node_options.h index fe20022bb2f..3258d4b3f0d 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -100,6 +100,7 @@ class DebugOptions : public Options { class EnvironmentOptions : public Options { public: bool abort_on_uncaught_exception = false; + std::vector<std::string> conditions; bool enable_source_maps = false; bool experimental_json_modules = false; bool experimental_modules = false; |