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

fix: merge userConfig inside getViteConfig (#11194)

This commit is contained in:
Emanuele Stoppa 2024-06-06 14:22:57 +01:00 committed by GitHub
parent a64428d11b
commit 97fbe938a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes an issue where the function `getViteConfig` wasn't returning the correct merged Astro configuration

View file

@ -34,7 +34,7 @@ export function getViteConfig(inlineConfig: UserConfig, inlineAstroConfig: Astro
dest: nodeLogDestination,
level: 'info',
});
const { astroConfig: config } = await resolveConfig(inlineAstroConfig, cmd);
const { astroConfig: config, userConfig } = await resolveConfig(inlineAstroConfig, cmd);
let settings = await createSettings(config, inlineConfig.root);
settings = await runHookConfigSetup({ settings, command: cmd, logger });
const viteConfig = await createVite(
@ -48,6 +48,6 @@ export function getViteConfig(inlineConfig: UserConfig, inlineAstroConfig: Astro
{ settings, logger, mode }
);
await runHookConfigDone({ settings, logger });
return mergeConfig(viteConfig, inlineConfig);
return mergeConfig(viteConfig, userConfig);
};
}

View file

@ -199,5 +199,5 @@ export async function resolveConfig(
const mergedConfig = mergeConfig(userConfig, inlineUserConfig);
const astroConfig = await validateConfig(mergedConfig, root, command);
return { userConfig, astroConfig };
return { userConfig: mergedConfig, astroConfig };
}