Repository navigation
Conversation
Add an ::: important callout to the SSG docs clarifying that `vite build` locally only produces the worker and client bundles — prerendered HTML files are generated remotely at deploy time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cecd158 to
8a75299
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce confusion around SSG prerendering behavior and deployment expectations, and also adjusts asset routing to accommodate UnoCSS’s dev-time virtual CSS endpoint.
Changes:
- Exclude
/__uno*from therun_worker_firstasset routing list (and update the SSR playground integration test expectation). - Add a callout to the SSG docs about when prerendered HTML is generated.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/void/test/integration/ssr-playground.test.ts | Updates expected wrangler.json assets.run_worker_first list to include the UnoCSS exclusion. |
| packages/void/src/index.ts | Adds /__uno* exclusion to run_worker_first to prevent routing UnoCSS virtual CSS requests through the worker. |
| docs/ssg.md | Adds a prerendering clarification callout in the SSG “How it works” section. |
Comments suppressed due to low confidence (1)
docs/ssg.md:28
- The
::: importantcontainer type doesn’t appear to be supported by this docs markdown setup (supported containers aretip,warning,danger,info,details). Consider switching this to a supported container (e.g.::: warning) or to a GitHub alert block (> [!IMPORTANT]) so it renders correctly.
::: important
Running `vite build` locally does **not** generate HTML files — the build only produces the worker and client asset bundles. Prerendered HTML files are generated remotely when the app is deployed.
:::
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| During `vite build`, after both the worker and client bundles are written to disk, Void spins up Miniflare with the built worker and fetches each page. The HTML responses are written to `dist/client/` as static files (e.g. `/about` becomes `dist/client/about.html`). | ||
|
|
||
| ::: important | ||
| Running `vite build` locally does **not** generate HTML files — the build only produces the worker and client asset bundles. Prerendered HTML files are generated remotely when the app is deployed. |
There was a problem hiding this comment.
This note says vite build locally does not generate prerendered HTML and that HTML is generated remotely at deploy time, but the implementation for output: "static" prerenders during the Vite build (void:prerender runs in closeBundle and writes HTML into dist/client/). This also contradicts the bullets/table above that describe build-time prerendering. Please adjust the wording to match the actual behavior (or update the implementation if behavior has changed).
| Running `vite build` locally does **not** generate HTML files — the build only produces the worker and client asset bundles. Prerendered HTML files are generated remotely when the app is deployed. | |
| When `output` is set to `"static"`, running `vite build` locally **does** generate prerendered HTML files in `dist/client/` alongside your client assets. Deploy commands such as `wrangler deploy`, self-hosting, or `void deploy` then upload these pre-built files; they do not re-run prerendering on the remote platform. |
There was a problem hiding this comment.
Even copilot has this wrong understanding. LOL
|
Wrong understanding. HTML are indeed generated locally. |
Summary
::: importantcallout to SSG docs clarifying thatvite buildlocally does not generate HTML filesContext
The "How it works" section describes the Miniflare-based prerender mechanism but doesn't make it clear that this only happens at deploy time. This caused confusion when running
vite buildlocally and finding no.htmlfiles indist/client/.🤖 Generated with Claude Code