Build and publish

One command gives you a folder of static HTML, every page prerendered, only the CSS you use.

Edit page

Build

Terminal
yarn build

Rsbuild bundles the site, then scripts/prerender.mjs renders every route to its own HTML file with its title and description. The browser shows the page before JavaScript arrives, and crawlers see the whole content.

build/
index.html
docs/index.html
docs/installation/index.html
…
404.html          noindex

Only the CSS you use

In yarn start every helper exists, so any class works the moment you type it. The build keeps only the classes it finds as text in src and public/index.html. The ranges can be as wide as you like.

Write class names whole. 'bg-' + name is invisible to the build and the class disappears. If a name has to be built, add a pattern to safelistin rsbuild.config.js. PURGE=off yarn build builds without removing anything, to compare.

Publish

The build folder works on any static host. Netlify and Cloudflare Pages read two files from it:

FileWhat it does
404.htmlserved with a 404 status for unknown addresses
_headerscaches the hashed files in /static/ for a year

Before you publish

Terminal
yarn check

Lists every placeholder left: example.com in the sitemap and robots.txt, relative Open Graph URLs and the missing canonical link.