Skip to content

docs: clarify SSG prerendering happens remotely - #7

Closed
hyfdev wants to merge 1 commit into
mainfrom
docs/ssg-prerender-callout
Closed

hyfdev wants to merge 1 commit into
mainfrom
docs/ssg-prerender-callout

Conversation

@hyfdev

@hyfdev hyfdev commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add ::: important callout to SSG docs clarifying that vite build locally does not generate HTML files
  • Prerendered HTML files are generated remotely when the app is deployed, not during local builds

Context

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 build locally and finding no .html files in dist/client/.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 27, 2026 16:58
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>
@hyfdev
hyfdev force-pushed the docs/ssg-prerender-callout branch from cecd158 to 8a75299 Compare February 27, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the run_worker_first asset 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 ::: important container type doesn’t appear to be supported by this docs markdown setup (supported containers are tip, 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.

Comment thread docs/ssg.md
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.

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even copilot has this wrong understanding. LOL

@hyfdev

hyfdev commented Feb 28, 2026

Copy link
Copy Markdown
Contributor Author

Wrong understanding. HTML are indeed generated locally.

@hyfdev hyfdev closed this Feb 28, 2026
@cpojer
cpojer deleted the docs/ssg-prerender-callout branch May 7, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants