Skip to content

Commit f7c841c

Browse files
authored
fix: hash import does not need to load from node_modules (oxc-project#501)
1 parent cae2beb commit f7c841c

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

napi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "oxc_napi_resolver"
33
version = "8.0.0"
4-
publish = true
54
authors.workspace = true
65
categories.workspace = true
76
edition.workspace = true
87
homepage.workspace = true
98
include.workspace = true
109
keywords.workspace = true
1110
license.workspace = true
11+
publish = true
1212
readme.workspace = true
1313
repository.workspace = true
1414
rust-version.workspace = true

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,8 @@ impl<C: Cache> ResolverGeneric<C> {
463463
) -> Result<C::Cp, ResolveError> {
464464
debug_assert_eq!(specifier.chars().next(), Some('#'));
465465
// a. LOAD_PACKAGE_IMPORTS(X, dirname(Y))
466-
if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? {
467-
return Ok(path);
468-
}
469-
self.load_package_self_or_node_modules(cached_path, specifier, ctx)
466+
self.load_package_imports(cached_path, specifier, ctx)?
467+
.map_or_else(|| Err(ResolveError::NotFound(specifier.to_string())), Ok)
470468
}
471469

472470
fn require_bare(

0 commit comments

Comments
 (0)