From 034fee052abc1552343cb4b09bd0042f9bc02633 Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Thu, 12 Feb 2026 14:50:04 -0500 Subject: [PATCH] fix: add direct check for false browser field in resolveLegacy to prevent exclusion Signed-off-by: Okiki Ojo --- core/utils/cdn-resolution.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/utils/cdn-resolution.ts b/core/utils/cdn-resolution.ts index b5638af..4a816b5 100644 --- a/core/utils/cdn-resolution.ts +++ b/core/utils/cdn-resolution.ts @@ -268,6 +268,15 @@ export function resolveLegacy( }; try { + // Step 0: Direct boolean false check on browser field + // resolve.exports' legacy() falls through to main when browser is false, + // so we must detect this exclusion before calling legacy() + if (conditions.browser && manifest.browser === false) { + result.excluded = true; + result.exclusionReason = "browser"; + return result; + } + // Step 1: Check browser field if browser conditions requested if (conditions.browser) { const withBrowser = legacy(manifest, { -- knotmirror 0.0.1