Skip to content

Commit 37bc251

Browse files
committed
feat: enable ts support by process.env.EGG_TS_ENABLE = true
1 parent a99a87f commit 37bc251

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/import.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ let _supportTypeScript: boolean | undefined;
4040
export function isSupportTypeScript() {
4141
if (_supportTypeScript === undefined) {
4242
const extensions = getExtensions();
43-
_supportTypeScript = extensions['.ts'] !== undefined || process.env.VITEST === 'true';
44-
debug('[isSupportTypeScript] %o, extensions: %j, process.env.VITEST: %j',
45-
_supportTypeScript, Object.keys(extensions), process.env.VITEST);
43+
// enable ts by process.env.EGG_TS_ENABLE or process.env.VITEST
44+
_supportTypeScript = extensions['.ts'] !== undefined || process.env.VITEST === 'true' || process.env.EGG_TS_ENABLE === 'true';
45+
debug('[isSupportTypeScript] %o, extensions: %j, process.env.VITEST: %j, process.env.EGG_TS_ENABLE: %j',
46+
_supportTypeScript, Object.keys(extensions), process.env.VITEST, process.env.EGG_TS_ENABLE);
4647
}
4748
return _supportTypeScript;
4849
}

0 commit comments

Comments
 (0)