add pnpm preview:website to test the prerendered build locally - #33
Merged
Merged
Conversation
dev:website runs Vite's dev server, which never runs the SSR/prerender step - #root starts empty there and only the client render fills it in. There was no easy way to see or debug the actual prerendered HTML a crawler or no-JS client gets without deploying. preview:website builds (prerender step included) and serves the real dist/ output with Vite's own preview server - a plain build-then-serve, no watch/hot-reload, since that would mean rebuilding on every change (tsc + two vite build passes + the prerender script) for a workflow reached for occasionally rather than run all day like dev:website. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm preview:website(root) — builds the website (SSR/prerender step included) and serves the realdist/output via Vite's ownpreviewserver, matching the existingdev:website/build:websitenaming pattern.pnpm dev:websitenever exercises the prerender step: Vite's dev server servesindex.htmlas-is, so#rootstarts empty and only the client-side render fills it in (by design — seeDECISIONS.md). There was no easy way to see or debug the actual prerendered HTML a no-JS client/crawler gets without deploying.website/package.jsonalready had apreviewscript (Vite scaffold default, unused until now) — this just wires it up at the root and documents it.tsc+ twovite buildpasses + the prerender script — wiring a watcher for that would add real complexity for a workflow you reach for occasionally to debug something prerender-specific, not one you run all day likedev:website. Documented that trade-off inwebsite/README.mdso it reads as a deliberate choice, not a gap.Test plan
pnpm run preview:websitefrom repo root builds and serves;curling the served output shows the real prerendered page content (same check as PR website: prerender to static HTML for no-JS crawlers/agents #31).pnpm run lint(oxlint, repo-wide) — no new warnings.../DECISIONS.mdfromwebsite/README.md).🤖 Generated with Claude Code