Repository navigation
Conversation
prerenderWithVite resolved the client output directory, the preview server and the server build entry against process.cwd(), so `vite build <dir>` and `createBuilder({ root })` failed to start the preview server or wrote index.html, pages.json and sitemap.xml outside the project whenever the Vite root was not the working directory.
Resolve all three against the resolved config root and pass root to vite.preview().
🦋 Changeset detectedLatest commit: cb8197b The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Walkthrough
Merge Risk:
|
Fixes #8824.
prerenderWithViteresolved its paths againstprocess.cwd()instead of Vite's resolvedroot, sovite build <dir>andcreateBuilder({ root })failed to start the preview server or wroteindex.html,pages.jsonandsitemap.xmloutside the project whenever root ≠ cwd. Nowrootis passed tovite.preview(), the preview server imports its entry viaresolve(server.config.root, …), andpost-server-buildreturns the client output directory resolved against the builder root;TSS_CLIENT_OUTPUT_DIRfollows suit.Verified with the reporter's reproducer built from the parent directory: before, exit 1 (
Could not resolve entry for router entry: router in <cwd>/app); after, exit 0,/prerendered into<project>/dist/client, nothing written to the working directory.vitest runinstart-plugin-core(49 files / 873 tests),tsc --noEmit,eslintandprettierare clean, andtests/prerender-vite.test.tshas a regression test for the resolved root and client output directory.Summary by CodeRabbit