Skip to content

Commit

Permalink
fix: merge userConfig inside getViteConfig (withastro#11194)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Jun 6, 2024
1 parent a64428d commit 97fbe93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-days-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes an issue where the function `getViteConfig` wasn't returning the correct merged Astro configuration
4 changes: 2 additions & 2 deletions packages/astro/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
};
}
2 changes: 1 addition & 1 deletion packages/astro/src/core/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}

0 comments on commit 97fbe93

Please sign in to comment.