0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

feat: create stub tsconfig if there are not any

This commit is contained in:
Florian Lefebvre 2024-08-16 16:44:23 +02:00
parent 15f154d9d5
commit 71ddbb4e0f

View file

@ -146,6 +146,11 @@ export async function resolveConfig(
inlineUserConfig.root = root;
}
const generatedTsConfigUrl = new URL('./.astro/tsconfig.json', inlineUserConfig.root);
if (!fsMod.existsSync(generatedTsConfigUrl)) {
fsMod.writeFileSync(generatedTsConfigUrl, '{}', 'utf-8');
}
const userConfig = await loadConfig(root, inlineOnlyConfig.configFile, fsMod);
const mergedConfig = mergeConfig(userConfig, inlineUserConfig);
// First-Pass Validation