From 7aba248ce1eb344feaf5ed3a6f83c3da4dd49448 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Fri, 1 Nov 2024 09:04:44 +0100 Subject: [PATCH] Try to resolve .ts file based on .js ext of id --- src/resolve.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resolve.ts b/src/resolve.ts index bf946a6e..7b270a67 100644 --- a/src/resolve.ts +++ b/src/resolve.ts @@ -66,7 +66,8 @@ export function jitiResolve( // Try resolving .ts files with .js extension if ( TS_EXT_RE.test(ctx.filename) || - TS_EXT_RE.test(ctx.parentModule?.filename || "") + TS_EXT_RE.test(ctx.parentModule?.filename || "") || + JS_EXT_RE.test(id) ) { resolved = tryNativeRequireResolve( ctx,