Skip to content

Commit

Permalink
fix(esm): shortCircuit in resolve as well
Browse files Browse the repository at this point in the history
  • Loading branch information
AviVahl committed Jul 20, 2023
1 parent b23a400 commit cd45b01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/esm/src/create-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -53,6 +53,7 @@ export function createLoader({ compilerOptions, cwd }: CreateLoaderOptions) {
if (resolvedModule && !definitionExtensions.has(resolvedModule.extension)) {
return {
url: pathToFileURL(resolvedModule.resolvedFileName).href,
shortCircuit: true,
};
}
}
Expand Down

0 comments on commit cd45b01

Please sign in to comment.