Build and publish
One command gives you a folder of static HTML, every page prerendered, only the CSS you use.
Build
yarn buildRsbuild 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.
index.html
docs/index.html
docs/installation/index.html
…
404.html noindexOnly 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:
| File | What it does |
|---|---|
404.html | served with a 404 status for unknown addresses |
_headers | caches the hashed files in /static/ for a year |
Before you publish
yarn checkLists every placeholder left: example.com in the sitemap and robots.txt, relative Open Graph URLs and the missing canonical link.