Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fix: only catch missing cts/mts error
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed May 16, 2022
1 parent 1c7b38d commit c4156db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export const resolve: resolve = async function (
) {
try {
return await resolve(`${specifier.slice(0, -2)}ts`, context, defaultResolve);
} catch {}
} catch (error) {
if ((error as any).code !== 'ERR_MODULE_NOT_FOUND') {
throw error;
}
}
}

if (tsExtensionsPattern.test(specifier)) {
Expand Down

0 comments on commit c4156db

Please sign in to comment.