Skip to content

Commit

Permalink
fix: invoke vite.build with up to date configuration during astro:bui…
Browse files Browse the repository at this point in the history
…ld:setup hook when target is "client" (#12763)

Co-authored-by: Alberto Matías <[email protected]>
  • Loading branch information
rbsummers and Alberto Matías authored Dec 17, 2024
1 parent 483da89 commit 8da2318
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-dots-sip.md
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ async function clientBuild(
base: settings.config.base,
};

await runHookBuildSetup({
const updatedViteBuildConfig = await runHookBuildSetup({
config: settings.config,
pages: internals.pagesByKeys,
vite: viteBuildConfig,
target: 'client',
logger: opts.logger,
});

const buildResult = await vite.build(viteBuildConfig);
const buildResult = await vite.build(updatedViteBuildConfig);
return buildResult;
}

Expand Down

0 comments on commit 8da2318

Please sign in to comment.