diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-10 14:46:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 14:46:25 -0400 |
commit | a49d0bd10ba2a4745c291f3f413d97396213e4ec (patch) | |
tree | 0c63c25304f465e969d2bcfb8bd71df8575c4033 /cli/standalone/binary.rs | |
parent | 4d2d764816d266e42f3b2251248b100abb667c83 (diff) |
fix(check): CJS types importing dual ESM/CJS package should prefer CJS types (#24492)
Closes #16370
Diffstat (limited to 'cli/standalone/binary.rs')
-rw-r--r-- | cli/standalone/binary.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 4d6b32b7d..10a762093 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -69,7 +69,7 @@ pub enum NodeModules { node_modules_dir: Option<String>, }, Byonm { - root_node_modules_dir: String, + root_node_modules_dir: Option<String>, }, } @@ -572,15 +572,16 @@ impl<'a> DenoCompileBinaryWriter<'a> { Some(root_dir), files, Some(NodeModules::Byonm { - root_node_modules_dir: root_dir_url - .specifier_key( - &ModuleSpecifier::from_directory_path( - // will always be set for byonm - resolver.root_node_modules_path().unwrap(), - ) - .unwrap(), - ) - .into_owned(), + root_node_modules_dir: resolver.root_node_modules_path().map( + |node_modules_dir| { + root_dir_url + .specifier_key( + &ModuleSpecifier::from_directory_path(node_modules_dir) + .unwrap(), + ) + .into_owned() + }, + ), }), ) } |