Static site generation for Bini.js. Pre-renders your routes to HTML as part of a single vite build.
bini-ssg pre-renders your entire application to static HTML during vite build. It expands dynamic paths, crawls internal links, and writes fallback pages for client-only routes.
The output is a fully static site (or a hybrid static/SPA app) that loads instantly and is perfectly optimized for SEO.
>= 8.0.0bini-router >= 2.0.0 (must already be installed and configured)react-dom, and react-router-domindex.html must contain an element with id="root"Register the plugin in your Bini.js config, directly after biniroute():
Run your build command (e.g. npm run build). bini-ssg will automatically build the client, build the SSR environment, and pre-render your routes:
Dynamic routes are only pre-rendered if they are reachable by crawling links or if you explicitly list their URLs using staticParams.
Export an async function from your dynamic page that returns an array of parameters:
Each object is mapped to the route pattern (e.g., /blog/:slug), and those URLs will be fully pre-rendered.
If you have a route that cannot be server-rendered (e.g., it relies heavily on browser APIs at the module scope), you can opt it out.
Export prerender = false from the page. bini-ssg will skip calling the server renderer for this route and will write an empty "shell" page instead. The client app will take over when the page loads.
bini-ssg automatically catches it and writes a shell page for that route instead of failing the build. The build will only crash if the SSR bundle itself fails to import.loader or action) are automatically marked as client-only by bini-router and will also receive a shell page.bini-ssg scans the HTML of every rendered page for internal <a href> links. If it finds a new link, it queues it and renders it too. This means a /blog page that lists links to all your posts will automatically pre-render every post without needing staticParams.
Dynamic patterns that are never reached by a crawled link get a fallback "shell" page. This is an empty index.html that loads your client-side router, allowing dynamic URLs to still work on static hosts.
index.html - Pre-rendered /.about/index.html - Pre-rendered static route.blog/hello-world/index.html - Pre-rendered dynamic route (via crawl or staticParams).admin/index.html - A "shell" page for a route with prerender = false.404.html - The not-found page, ready for static hosts.Static site generation for Bini.js. Pre-renders your routes to HTML as part of a single vite build.
bini-ssg pre-renders your entire application to static HTML during vite build. It expands dynamic paths, crawls internal links, and writes fallback pages for client-only routes.
The output is a fully static site (or a hybrid static/SPA app) that loads instantly and is perfectly optimized for SEO.
>= 8.0.0bini-router >= 2.0.0 (must already be installed and configured)react-dom, and react-router-domindex.html must contain an element with id="root"Register the plugin in your Bini.js config, directly after biniroute():
Run your build command (e.g. npm run build). bini-ssg will automatically build the client, build the SSR environment, and pre-render your routes:
Dynamic routes are only pre-rendered if they are reachable by crawling links or if you explicitly list their URLs using staticParams.
Export an async function from your dynamic page that returns an array of parameters:
Each object is mapped to the route pattern (e.g., /blog/:slug), and those URLs will be fully pre-rendered.
If you have a route that cannot be server-rendered (e.g., it relies heavily on browser APIs at the module scope), you can opt it out.
Export prerender = false from the page. bini-ssg will skip calling the server renderer for this route and will write an empty "shell" page instead. The client app will take over when the page loads.
bini-ssg automatically catches it and writes a shell page for that route instead of failing the build. The build will only crash if the SSR bundle itself fails to import.loader or action) are automatically marked as client-only by bini-router and will also receive a shell page.bini-ssg scans the HTML of every rendered page for internal <a href> links. If it finds a new link, it queues it and renders it too. This means a /blog page that lists links to all your posts will automatically pre-render every post without needing staticParams.
Dynamic patterns that are never reached by a crawled link get a fallback "shell" page. This is an empty index.html that loads your client-side router, allowing dynamic URLs to still work on static hosts.
index.html - Pre-rendered /.about/index.html - Pre-rendered static route.blog/hello-world/index.html - Pre-rendered dynamic route (via crawl or staticParams).admin/index.html - A "shell" page for a route with prerender = false.404.html - The not-found page, ready for static hosts.