From caf1dfbfcd47db796ebcf9e95f619379c254b3e4 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 10 Aug 2023 16:54:04 +0800 Subject: [PATCH] fix(resolver): fix a case where package name and specifier is the wrong order --- crates/oxc_resolver/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_resolver/src/lib.rs b/crates/oxc_resolver/src/lib.rs index 6f182f1d8..79e979d28 100644 --- a/crates/oxc_resolver/src/lib.rs +++ b/crates/oxc_resolver/src/lib.rs @@ -565,7 +565,7 @@ impl ResolverGeneric { ); } // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - let Some(subpath) = package_json.name.as_ref().and_then(|package_json_name| package_json_name.strip_prefix(specifier)) else { + let Some(subpath) = package_json.name.as_ref().and_then(|package_json_name| specifier.strip_prefix(package_json_name)) else { return Ok(None); }; // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE),