Prerendering a Vite SPA for SEO — Without Next.js

The conventional wisdom in the React community asserts that if you care about search engine optimization (SEO), social media share previews, and fast initial content paint, you must adopt a full-stack framework like Next.js or Remix. However, introducing Node.js runtime server hosting, serverless functions, or complex hybrid hydration is often excessive for marketing websites, documentation hubs, and developer portfolios.

My portfolio is architected as a pure client-side Vite + React SPA, yet it achieves perfect 100/100 Lighthouse SEO scores and instant search engine indexation. By implementing a deterministic build-time prerendering pipeline in plain Node.js, we generate crawlable static HTML files for every public route directly during the build step — without running a live server or migrating a single line of React code.

A major pitfall in manual prerendering workflows is route configuration drift. If the sitemap generator, prerender script, and client-side router each maintain their own list of URLs, new blog articles or nested pages inevitably get omitted from search index files.

← Rafael González Albes