Skip to content

Commit f1c1bc7

Browse files
committed
feat: detect typescript enable on env.VITEST === 'true'
1 parent a439076 commit f1c1bc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/import.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ let _supportTypeScript: boolean | undefined;
3636
export function isSupportTypeScript() {
3737
if (_supportTypeScript === undefined) {
3838
const extensions = getRequire().extensions;
39-
_supportTypeScript = extensions['.ts'] !== undefined;
40-
debug('[isSupportTypeScript] %o, extensions: %j', _supportTypeScript, Object.keys(extensions));
39+
_supportTypeScript = extensions['.ts'] !== undefined || process.env.VITEST === 'true';
40+
debug('[isSupportTypeScript] %o, extensions: %j, process.env.VITEST: %j',
41+
_supportTypeScript, Object.keys(extensions), process.env.VITEST);
4142
}
4243
return _supportTypeScript;
4344
}

0 commit comments

Comments
 (0)