Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
esm: rename flag --esm-extension-resolution
Browse files Browse the repository at this point in the history
There are currently two supported values
"none" and "auto"
  • Loading branch information
MylesBorins committed Mar 5, 2019
1 parent 2168312 commit d6a3b09
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file added default.profraw
Binary file not shown.
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ inline Maybe<URL> ResolveIndex(const URL& search) {
Maybe<URL> FinalizeResolution(Environment* env,
const URL& resolved,
const URL& base) {
if (env->options()->legacy_resolution) {
if (env->options()->esm_extension_resolution == "auto") {
Maybe<URL> file = ResolveExtensions<TRY_EXACT_NAME>(resolved);
if (!file.IsNothing()) {
return file;
Expand Down
6 changes: 3 additions & 3 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"(default: llhttp).",
&EnvironmentOptions::http_parser,
kAllowedInEnvironment);
AddOption("--legacy-resolution",
"legacy extension and folder resolution for ES Modules",
&EnvironmentOptions::legacy_resolution,
AddOption("--esm-extension-resolution",
"Select extension resolution algorithm for esm; either 'none' or 'auto'",
&EnvironmentOptions::esm_extension_resolution,
kAllowedInEnvironment);
AddOption("--no-deprecation",
"silence deprecation warnings",
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class EnvironmentOptions : public Options {
public:
bool abort_on_uncaught_exception = false;
bool experimental_modules = false;
bool legacy_resolution = false;
std::string esm_extension_resolution = "none";
std::string module_type;
std::string experimental_policy;
bool experimental_repl_await = false;
Expand Down

0 comments on commit d6a3b09

Please sign in to comment.