summaryrefslogtreecommitdiff
path: root/cli/npm/resolvers/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-17 17:38:50 -0400
committerGitHub <noreply@github.com>2023-05-17 17:38:50 -0400
commit41f618a1df6bb8c66d7968ac64456139b9f4c197 (patch)
treedbcc67e009cf70099be82ea3774669e8aefc6023 /cli/npm/resolvers/mod.rs
parentad223362451688c13a4441563210f58bdb046a78 (diff)
fix(npm): improved optional dependency support (#19135)
Note: If the package information has already been cached, then this requires running with `--reload` or for the registry information to be fetched some other way (ex. the cache busting). Closes #15544 --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/npm/resolvers/mod.rs')
-rw-r--r--cli/npm/resolvers/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/npm/resolvers/mod.rs b/cli/npm/resolvers/mod.rs
index f54e509f0..a41727dda 100644
--- a/cli/npm/resolvers/mod.rs
+++ b/cli/npm/resolvers/mod.rs
@@ -18,6 +18,7 @@ use deno_npm::resolution::NpmResolutionSnapshot;
use deno_npm::resolution::PackageReqNotFoundError;
use deno_npm::resolution::SerializedNpmResolutionSnapshot;
use deno_npm::NpmPackageId;
+use deno_npm::NpmSystemInfo;
use deno_runtime::deno_fs::FileSystem;
use deno_runtime::deno_node::NodePermissions;
use deno_runtime::deno_node::NodeResolutionMode;
@@ -289,6 +290,7 @@ pub fn create_npm_fs_resolver(
registry_url: Url,
resolution: Arc<NpmResolution>,
maybe_node_modules_path: Option<PathBuf>,
+ system_info: NpmSystemInfo,
) -> Arc<dyn NpmPackageFsResolver> {
match maybe_node_modules_path {
Some(node_modules_folder) => Arc::new(LocalNpmPackageResolver::new(
@@ -298,12 +300,14 @@ pub fn create_npm_fs_resolver(
registry_url,
node_modules_folder,
resolution,
+ system_info,
)),
None => Arc::new(GlobalNpmPackageResolver::new(
fs,
cache,
registry_url,
resolution,
+ system_info,
)),
}
}