0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix: invoke vite.build with up to date configuration during astro:build:setup hook when target is "client" (#12763)

Co-authored-by: Alberto Matías <alberto.matias@bestsecret.com>
This commit is contained in:
Alberto Matías Vega 2024-12-17 14:40:36 +01:00 committed by GitHub
parent 483da89cf6
commit 8da2318551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -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"

View file

@ -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;
}