From 71ddbb4e0fd81e1d6ea65281b5db4ec01fab2404 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 16 Aug 2024 16:44:23 +0200 Subject: [PATCH] feat: create stub tsconfig if there are not any --- packages/astro/src/core/config/config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index c10066ce32..6350bb80ae 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -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