Skip to content

add pnpm preview:website to test the prerendered build locally - #33

Merged
okcodes merged 1 commit into
mainfrom
website-preview-ssr-build
Sep 6, 2026
Merged

okcodes merged 1 commit into
mainfrom
website-preview-ssr-build

Conversation

@okcodes

@okcodes okcodes commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds pnpm preview:website (root) — builds the website (SSR/prerender step included) and serves the real dist/ output via Vite's own preview server, matching the existing dev:website / build:website naming pattern.
  • pnpm dev:website never exercises the prerender step: Vite's dev server serves index.html as-is, so #root starts empty and only the client-side render fills it in (by design — see DECISIONS.md). There was no easy way to see or debug the actual prerendered HTML a no-JS client/crawler gets without deploying.
  • website/package.json already had a preview script (Vite scaffold default, unused until now) — this just wires it up at the root and documents it.
  • Deliberately build-then-serve, not a watcher: no hot reload, refresh manually after each change. A full rebuild is tsc + two vite build passes + 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 like dev:website. Documented that trade-off in website/README.md so it reads as a deliberate choice, not a gap.

Test plan

  • pnpm run preview:website from 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.
  • Checked both new README links resolve (../DECISIONS.md from website/README.md).

🤖 Generated with Claude Code

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>
@okcodes
okcodes merged commit 2ca3f0d into main Sep 6, 2026
1 check passed
@okcodes
okcodes deleted the website-preview-ssr-build branch September 6, 2026 13:39
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.

1 participant