fix(browser): keep bare module locations unresolved (#676)

Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-06 16:18:36 +08:00
committed by GitHub
parent 7f1fa64019
commit 8189081511
5 changed files with 69 additions and 1 deletions
+7
View File
@@ -44,6 +44,13 @@ export const objectString = (
return t.isStringLiteral(value) ? value.value : undefined;
};
/** Whether module syntax supplies a URL location without a package/import-map resolver. */
export const isUrlLikeModuleSpecifier = (specifier: string): boolean =>
specifier.startsWith("/") ||
specifier.startsWith("./") ||
specifier.startsWith("../") ||
/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(specifier);
export const resolveSpecifier = (
specifier: string,
base: string,