summaryrefslogtreecommitdiff
path: root/cli/cache
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-05 19:23:51 -0500
committerGitHub <noreply@github.com>2024-03-06 00:23:51 +0000
commit3eaf174bfc64b7c277899abd44ae3877538028df (patch)
tree6a99dfd592681ca4beac81aaa9e5115e3dd801d7 /cli/cache
parent3fd4b882a4bd0087ebf112615aafc314bb71e594 (diff)
fix(node): improve cjs tracking (#22673)
We were missing saying that a file is CJS when some Deno code imported from the node_modules directory at runtime.
Diffstat (limited to 'cli/cache')
-rw-r--r--cli/cache/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs
index 7d95a6423..229a9cb54 100644
--- a/cli/cache/mod.rs
+++ b/cli/cache/mod.rs
@@ -196,7 +196,9 @@ impl Loader for FetchCacher {
) -> LoadFuture {
use deno_graph::source::CacheSetting as LoaderCacheSetting;
- if specifier.path().contains("/node_modules/") {
+ if specifier.scheme() == "file"
+ && specifier.path().contains("/node_modules/")
+ {
// The specifier might be in a completely different symlinked tree than
// what the node_modules url is in (ex. `/my-project-1/node_modules`
// symlinked to `/my-project-2/node_modules`), so first we checked if the path