From 1eac7a166713b65e17aabdf087cf63d17f30da6a Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Sun, 25 Jan 2026 01:54:27 -0500 Subject: [PATCH] style: pass along build to cdn plugin Signed-off-by: Okiki Ojo --- core/plugins/external.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/plugins/external.ts b/core/plugins/external.ts index 84538bd..4aaa7e9 100644 --- a/core/plugins/external.ts +++ b/core/plugins/external.ts @@ -1,7 +1,9 @@ import type { LocalState, ESBUILD } from "../types.ts"; import type { Context } from "../context/context.ts"; +import type { CdnResolutionState } from "./cdn.ts"; import { fromContext } from "../context/context.ts"; +import { CdnResolution } from "./cdn.ts"; import { parsePackageName } from "@bundle/utils/parse-package-name"; import { encode } from "@bundle/utils/encode-decode"; @@ -9,8 +11,6 @@ import { encode } from "@bundle/utils/encode-decode"; import { getCDNUrl } from "../utils/cdn-format.ts"; import { isAlias } from "./alias.ts"; -import { CdnResolution } from "./cdn.ts"; - /** External Plugin Namespace */ export const EXTERNALS_NAMESPACE = "external-globals"; @@ -119,11 +119,8 @@ export function ExternalPlugin(StateContext: Context>): ESBUILD const pkgDetails = parsePackageName(argPath); const aliasPath = PolyfillMap[pkgDetails.name as keyof typeof PolyfillMap]; - const ctx = StateContext.with({ origin: host }) as Context & { origin: string }>; - return CdnResolution(ctx)({ - ...args, - path: aliasPath - }); + const ctx = StateContext.with({ build, origin: host }) as Context>; + return CdnResolution(ctx)(Object.assign({}, args, { path: aliasPath })); } return { -- 2.54.0