Prerendering a Vite SPA for SEO — Without Next.js

You do not need Next.js for crawlable HTML. My portfolio is a Vite + React SPA. After vite build, a Node script writes a static HTML snapshot for every public route so crawlers see real content before JavaScript runs. The SEO article covers titles and schema; this one covers how the HTML gets on disk.

scripts/seo-routes.cjs is the source of truth. It lists static pages plus every writing article from writing-articles.json. The same list feeds the sitemap generator, the prerender script, and check-qa.cjs.

When I add an article, the slug becomes a /writing/... route automatically. Sitemap, prerender, and QA stay in sync because they read one file — not three hand-maintained copies.

← Rafael González Albes