Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: merge userConfig inside getViteConfig #11194

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 };
}
Loading