From cd45b01ebb35df1ac771a88aab0de5fb89fb0691 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Thu, 20 Jul 2023 17:36:19 +0300 Subject: [PATCH] fix(esm): shortCircuit in resolve as well --- packages/esm/src/create-loader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/esm/src/create-loader.ts b/packages/esm/src/create-loader.ts index f65b819..b71504b 100644 --- a/packages/esm/src/create-loader.ts +++ b/packages/esm/src/create-loader.ts @@ -17,7 +17,7 @@ export type ResolveHook = ( specifier: string, context: { parentURL?: string; conditions: string[] }, defaultResolve: ResolveHook, -) => { url: string; format?: ModuleFormat }; +) => { url: string; format?: ModuleFormat; shortCircuit?: boolean }; /** @url https://nodejs.org/docs/latest-v16.x/api/esm.html#loadurl-context-defaultload */ export type LoadHook = ( @@ -53,6 +53,7 @@ export function createLoader({ compilerOptions, cwd }: CreateLoaderOptions) { if (resolvedModule && !definitionExtensions.has(resolvedModule.extension)) { return { url: pathToFileURL(resolvedModule.resolvedFileName).href, + shortCircuit: true, }; } }