Vite Prerender Plugin

JSON →
library 0.5.13 ·javascript
verified May 27, 2026

vite-prerender-plugin is a Vite plugin designed to perform server-side rendering (prerendering) of web applications to static HTML during the build process. This is particularly useful for improving initial page load performance and SEO for sites that don't require full server-side rendering on every request. The current stable version is `0.5.13`, with minor updates released somewhat regularly to address bug fixes and ensure compatibility with newer Vite versions, currently supporting Vite 5.x through 8.x. A key differentiator of this plugin is its highly flexible approach, being an extraction of the prerendering functionality from the Preact ecosystem's `@preact/preset-vite` and WMR. It delegates the actual rendering logic to the user, who must provide an exported `prerender()` function within a specified script. This function can be synchronous or asynchronous, allowing for data fetching and file system access, and is expected to return an object containing an `html` property with the rendered string. The plugin then injects this HTML into the main document at a configurable `renderTarget` selector, and can automatically discover and prerender additional routes.

total hits 24
actors 8 distinct systems
last hit 17h ago human
GPTBot
5
ChatGPT-User
4
MetaBot
4
Script
1
Search engines
2
Humans
4

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇵🇱 Poland · 🇬🇧 United Kingdom · 🇨🇭 Switzerland