mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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.
This commit is contained in:
parent
3fd4b882a4
commit
3eaf174bfc
12 changed files with 250 additions and 169 deletions
4
cli/cache/mod.rs
vendored
4
cli/cache/mod.rs
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue