banira prerender

Render the components to static HTML using Declarative Shadow DOM.

Usage

$ banira prerender <files...> [options]

Arguments

ArgumentDescription
<files...>Component source files to prerender.

Options

OptionDescription
-o, --output <path>Write the markup to a file instead of stdout.

Examples

prerender to a file
$ banira prerender src/*.ts -o prerendered.html

Notes

Uses Declarative Shadow DOM so the shadow content is present in the served HTML — useful for first paint and for consumers without JavaScript enabled. A component's constructable stylesheet is inlined as critical CSS so the markup is styled before JS (FOUC-free).

For programmatic SSR, the createPrerenderer(files) library export returns renderToString(tag, { attributes, children }) for meta-frameworks, and createEleventyPlugin wires that into an Eleventy build. On the client, hydrateShadow adopts the prerendered root (no re-render, no flash).