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
checkEmitted | The files emit returned, refused when one would land outside the output (an absolute path, a ..) or on a file the build writes itself: a page, the sitemap,… |
defineManifest | Construct a verified Manifest<Tag> where every tag in tags is present exactly once. Fails at compile time if any tag is missing or duplicated in tags, and… |
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… |
manifestFromChunks | Build a Manifest<Tag> from chunk groupings { chunk, tags, with? }, refusing any tag claimed by two chunks or any expected tag left unclaimed. |
manifestPlugin | Vite plugin that emits the runtime entry chunk (absorbing runtimeChunk) and any declared per-Message / per-Surface chunks, exposing the resulting Manifest… |
runtimeChunk | Emits entry, the module the loader's runtime imports, as a chunk of the client build, and writes that chunk's address into the loader. The chunk is the one… |
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… |
writeEmitted | Writes what emit returned into outDir, refusing a file the client build already wrote there: a file from public/ is not emit's to replace. |
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. |
EmittedFile | A file emit adds: its path in the output, and its contents. |
ManifestEntry | One tag's home chunk and any companion chunks (e.g. Command Effects) loaded alongside it. |
ManifestPluginOptions | |
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… |
Types
Head | What a page adds to its head, given what it rendered and the compiled classes it drew: such as a stylesheet of those classes (Style.usedDrawn in… |
Manifest | Exhaustive map from every Message tag in Tag to its single chunk home. |
SitePath | A path the site generates, with the date its sitemap names when it has one. |
UniqueTuple | Compile-time check that a tuple of tag names contains no duplicates. |