diff options
Diffstat (limited to 'cli/cache/mod.rs')
-rw-r--r-- | cli/cache/mod.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index 90f88530f..a962538b7 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -2,7 +2,6 @@ use crate::errors::get_error_class_name; use crate::file_fetcher::FileFetcher; -use crate::util::fs::canonicalize_path; use deno_core::futures; use deno_core::futures::FutureExt; @@ -108,12 +107,8 @@ impl Loader for FetchCacher { // is in a node_modules dir to avoid needlessly canonicalizing, then compare // against the canonicalized specifier. if specifier.path().contains("/node_modules/") { - let specifier = specifier - .to_file_path() - .ok() - .and_then(|path| canonicalize_path(&path).ok()) - .and_then(|path| ModuleSpecifier::from_file_path(path).ok()) - .unwrap_or_else(|| specifier.clone()); + let specifier = + crate::node::resolve_specifier_into_node_modules(specifier); if specifier.as_str().starts_with(node_modules_url.as_str()) { return Box::pin(futures::future::ready(Ok(Some( LoadResponse::External { specifier }, |