Skip to content

Commit 4908ffc

Browse files
authored
feat: enable ts support by process.env.EGG_TS_ENABLE = true (#43)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - **Expanded TypeScript Support Detection:** The application now checks an additional configuration option to determine TypeScript support. This enhancement provides a more reliable activation process for TypeScript projects. - **Enhanced Logging:** Diagnostic output has been improved to display a more comprehensive summary of the configuration settings, making it easier to trace and verify support conditions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a99a87f commit 4908ffc

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)