summaryrefslogtreecommitdiff
path: root/cli/npm/byonm.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-29 09:32:23 -0500
committerGitHub <noreply@github.com>2023-11-29 09:32:23 -0500
commit9ac405d587ca1465debd4a65a09324b7a6b2c04f (patch)
treeb3cc4adb3ddf06dc5d380c39f9e8a82c24b25655 /cli/npm/byonm.rs
parent7e56a0466fc9964ca5dd3533bb65c00cd1bac4dc (diff)
feat(compile): support "bring your own node_modules" in deno compile (#21377)
Not tested thoroughly. This is a good start. Closes #21350
Diffstat (limited to 'cli/npm/byonm.rs')
-rw-r--r--cli/npm/byonm.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs
index 469f98828..aeb1c28b8 100644
--- a/cli/npm/byonm.rs
+++ b/cli/npm/byonm.rs
@@ -19,7 +19,7 @@ use deno_semver::package::PackageReq;
use crate::args::package_json::get_local_package_json_version_reqs;
use crate::args::NpmProcessState;
use crate::args::NpmProcessStateKind;
-use crate::util::fs::canonicalize_path_maybe_not_exists;
+use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs;
use crate::util::path::specifier_to_file_path;
use super::common::types_package_name;
@@ -188,8 +188,8 @@ impl CliNpmResolver for ByonmCliNpmResolver {
InnerCliNpmResolverRef::Byonm(self)
}
- fn root_node_modules_path(&self) -> Option<std::path::PathBuf> {
- Some(self.root_node_modules_dir.clone())
+ fn root_node_modules_path(&self) -> Option<&PathBuf> {
+ Some(&self.root_node_modules_dir)
}
fn resolve_pkg_folder_from_deno_module_req(
@@ -215,7 +215,10 @@ impl CliNpmResolver for ByonmCliNpmResolver {
.unwrap()
.join("node_modules")
.join(key);
- return Ok(canonicalize_path_maybe_not_exists(&package_path)?);
+ return Ok(canonicalize_path_maybe_not_exists_with_fs(
+ &package_path,
+ fs,
+ )?);
}
}
}