Skip to content

Commit ae3dea0

Browse files
authored
feat: detect native typescript support on node (#14)
1 parent dffade0 commit ae3dea0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/detect.ts

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ let _isNativeTsImportSupported: boolean | undefined
7979

8080
export async function isNativeTsImportSupported(): Promise<boolean> {
8181
if (_isNativeTsImportSupported === undefined) {
82+
// @ts-expect-error missing `typescript` property
83+
// eslint-disable-next-line node/prefer-global/process
84+
if (typeof process !== 'undefined' && process.features?.typescript) {
85+
return _isNativeTsImportSupported = true
86+
}
8287
try {
8388
const modName = 'dummy.mts'
8489
const mod = await import(`../runtime-fixtures/${modName}`)

0 commit comments

Comments
 (0)