Skip to main content
Vite projects work as they are. npm create @fluid-app/fluid-site my-site starts you on Vite and React; an existing Vite project needs only the SDK.

Set up

Import it once, at the top of your entry file:
src/main.tsx
Keep Vite’s default base of / and its default build folder, dist.

Routing

With no config/routes.json, every path that isn’t a file is answered by index.html, which is what a client-side router needs. Inside the storefront, let your router follow Back and Forward:
See Routes to send some paths to other files. A single-page app’s index.html is empty until its script runs, so a crawler that doesn’t run JavaScript sees nothing. Add the fluidSite() plugin from @fluid-app/sites/vite, and the build writes what crawlers read:
vite.config.ts
After vite build, it reads config/meta.json and writes:
  • the title, description, Open Graph and Twitter tags into index.html;
  • one index.html per route, such as events/index.html, each with that route’s own tags;
  • llms.txt, and sitemap.xml when config/meta.json gives the site’s absolute url.
A route marked noindex is left out of the sitemap and llms.txt. See SEO and indexing for config/meta.json, and for which title wins on the storefront.

Deploy

Run fluid sites dev instead of npm run dev to get a working fluid.db while you build.