Skip to content

Commit a639836

Browse files
fix: override Node's native TS formats (#733)
Co-authored-by: Hiroki Osame <[email protected]>
1 parent bddd4f5 commit a639836

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/esm/hook/resolve.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ let resolve: ResolveHook = async (
335335

336336
// For TypeScript extensions that Node can't detect the format of
337337
if (
338-
!resolved.format
338+
(
339+
!resolved.format
340+
|| resolved.format === 'commonjs-typescript'
341+
|| resolved.format === 'module-typescript'
342+
)
339343
// Filter out data: (sourcemaps)
340344
&& resolved.url.startsWith(fileUrlPrefix)
341345
) {

0 commit comments

Comments
 (0)