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

feat: add check

This commit is contained in:
Florian Lefebvre 2024-08-16 16:45:05 +02:00
parent 71ddbb4e0f
commit 9309c7eec2

View file

@ -146,11 +146,6 @@ 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
@ -170,5 +165,12 @@ export async function resolveConfig(
throw e;
}
if (astroConfig.experimental.typescript) {
const generatedTsConfigUrl = new URL('./.astro/tsconfig.json', astroConfig.root);
if (!fsMod.existsSync(generatedTsConfigUrl)) {
fsMod.writeFileSync(generatedTsConfigUrl, '{}', 'utf-8');
}
}
return { userConfig: mergedConfig, astroConfig };
}