diff --git a/.changeset/heavy-dots-sip.md b/.changeset/heavy-dots-sip.md new file mode 100644 index 0000000000..2e0c4c29b1 --- /dev/null +++ b/.changeset/heavy-dots-sip.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixed changes to vite configuration made in the astro:build:setup integration hook having no effect when target is "client" diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 0535aaa7ac..935b4a2d5d 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -283,7 +283,7 @@ async function clientBuild( base: settings.config.base, }; - await runHookBuildSetup({ + const updatedViteBuildConfig = await runHookBuildSetup({ config: settings.config, pages: internals.pagesByKeys, vite: viteBuildConfig, @@ -291,7 +291,7 @@ async function clientBuild( logger: opts.logger, }); - const buildResult = await vite.build(viteBuildConfig); + const buildResult = await vite.build(updatedViteBuildConfig); return buildResult; }