SSR / API

foldkit-ssr/vite

foldkit-ssr/vite: the static half of a build, as a Vite plugin. After Vite writes the client bundle, staticSite renders every path with SSR.generate and writes each page where a static host serves its address, with the sitemap and robots.txt beside them. It owns no build: it runs as a closeBundle step on the application's own client build, with the application's own template.

The application describes its site in a module the plugin evaluates through a server (workspace packages resolve to source, as the build does), so vite.config.ts names a file, never application code.

Functions

fileForThe file a static host serves for a path. directory is the package's own layout (/about as about/index.html); flat writes about.html, for hosts with clean…
generateStaticSiteRenders a static site: every path through SSR.generate, one page per path in order, with the sitemap and robots text the options ask for. A build id must…
staticSiteA static site as a Vite plugin: after the client bundle is written, the site module is evaluated, every path is rendered into the built shell, and the pages…

Interfaces

BuiltPageOne generated page, with the file the host serves it from.
BuiltSiteWhat a static site build produced: its pages, and its sitemap and robots text.
SiteModuleA site description as a module exports it, for the plugin to evaluate.
StaticSiteWhat a static site is: everything SSR.generate takes, plus where its pages land. config may read the path (a site whose Model is prepared per page satisfies…

Types

HeadWhat a page adds to its head, given what it rendered: such as a stylesheet of the classes the markup uses (Style.usedIn in foldkit-mixins). The same shape…
SitePathA path the site generates, with the date its sitemap names when it has one.