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
fileFor | The 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… |
generateStaticSite | Renders 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… |
staticSite | A 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
BuiltPage | One generated page, with the file the host serves it from. |
BuiltSite | What a static site build produced: its pages, and its sitemap and robots text. |
SiteModule | A site description as a module exports it, for the plugin to evaluate. |
StaticSite | What 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… |