From 049e703331409db8c4b4e2cc7d969f471c229df3 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 5 Apr 2024 10:34:51 -0400 Subject: FUTURE: override byonm with nodeModulesDir setting (#23222) Makes the `"nodeModulesDir"` setting take precedence over byonm when using `DENO_FUTURE`. --- cli/tools/vendor/mod.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cli/tools/vendor/mod.rs') diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs index 2e01d1963..5a76365ee 100644 --- a/cli/tools/vendor/mod.rs +++ b/cli/tools/vendor/mod.rs @@ -99,13 +99,14 @@ pub async fn vendor( // cache the node_modules folder when it's been added to the config file if modified_result.added_node_modules_dir { - let node_modules_path = cli_options.node_modules_dir_path().or_else(|| { - cli_options - .maybe_config_file_specifier() - .filter(|c| c.scheme() == "file") - .and_then(|c| c.to_file_path().ok()) - .map(|config_path| config_path.parent().unwrap().join("node_modules")) - }); + let node_modules_path = + cli_options.node_modules_dir_path().cloned().or_else(|| { + cli_options + .maybe_config_file_specifier() + .filter(|c| c.scheme() == "file") + .and_then(|c| c.to_file_path().ok()) + .map(|config_path| config_path.parent().unwrap().join("node_modules")) + }); if let Some(node_modules_path) = node_modules_path { let cli_options = cli_options.with_node_modules_dir_path(node_modules_path); -- cgit v1.2.3