Revert "fix(resolver): fix a case where package name and specifier is the wrong order"

This reverts commit caf1dfbfcd.
This commit is contained in:
Boshen 2023-08-24 22:03:30 +08:00
parent a272c1ffe4
commit 531e89a74a
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1

View file

@ -633,7 +633,7 @@ impl<Fs: FileSystem> ResolverGeneric<Fs> {
);
}
// 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| specifier.strip_prefix(package_json_name)) else {
let Some(subpath) = package_json.name.as_ref().and_then(|package_json_name| package_json_name.strip_prefix(specifier)) else {
return Ok(None);
};
// 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE),