From 9201198efd6fb116585d4c26111669f4c1006e5d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 7 Nov 2023 09:56:06 -0500 Subject: fix(node): inspect ancestor directories when resolving cjs re-exports during analysis (#21104) If a CJS re-export can't be resolved, it will check the ancestor directories, which is more similar to what `require` does at runtime. --- ext/node/ops/require.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/node/ops') diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index ceb771bf9..8010558c5 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -209,7 +209,7 @@ pub fn op_require_is_deno_dir_package( #[string] path: String, ) -> bool { let resolver = state.borrow::(); - resolver.in_npm_package_at_path(&PathBuf::from(path)) + resolver.in_npm_package_at_file_path(&PathBuf::from(path)) } #[op2] @@ -484,7 +484,7 @@ where let permissions = state.borrow::

(); let pkg_path = if npm_resolver - .in_npm_package_at_path(&PathBuf::from(&modules_path)) + .in_npm_package_at_file_path(&PathBuf::from(&modules_path)) && !uses_local_node_modules_dir { modules_path -- cgit v1.2.3