From 5db158f0d6ba4a899cd245fabedd207553004167 Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Thu, 29 Jan 2026 20:59:02 -0500 Subject: [PATCH] chore: avoid duplicate remappings in browser remapping Signed-off-by: Okiki Ojo --- core/utils/cdn-resolution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/utils/cdn-resolution.ts b/core/utils/cdn-resolution.ts index 2baba8a..01e1a5f 100644 --- a/core/utils/cdn-resolution.ts +++ b/core/utils/cdn-resolution.ts @@ -317,12 +317,12 @@ export function applyBrowserRemapping( if (!remappings || !resolvedPath) return resolvedPath; // Try multiple path variants for matching - const variants = [ + const variants = new Set([ resolvedPath, resolvedPath.replace(/^\.\//, ""), resolvedPath.startsWith("./") ? resolvedPath : `./${resolvedPath.replace(/^\//, "")}`, resolvedPath.replace(/^\//, ""), - ]; + ]); for (const variant of variants) { if (variant in remappings) { -- knotmirror 0.0.1