From f0e5f6ca92519c8ac799b23c09f9607e661104a3 Mon Sep 17 00:00:00 2001 From: sunyiteng Date: Mon, 21 Oct 2024 15:59:54 +0800 Subject: [PATCH] chore: update --- src/lib.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index afc034f..e4ddad9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1063,16 +1063,9 @@ impl ResolverGeneric { } // Bail if path is module directory such as `ipaddr.js` ctx.with_fully_specified(true); - if cached_path.is_dir(&self.cache.fs, ctx) { + if !cached_path.is_file(&self.cache.fs, ctx) { ctx.with_fully_specified(false); return Ok(None); - } else if !cached_path.is_file(&self.cache.fs, ctx) { - if let Ok(path) = - self.load_package_exports(filename.to_string_lossy().as_ref(), "", cached_path, ctx) - { - ctx.with_fully_specified(false); - return Ok(path); - } } // Create a meaningful error message. let dir = path.parent().unwrap().to_path_buf();