Registry / web-framework / vite-plugin-prerenderer

vite-plugin-prerenderer

JSON →
library1.0.1jsnpmunverified

A Vite plugin for prerendering applications to static HTML using Puppeteer, targeting improved SEO and faster initial page loads. Version 1.0.1 is the current stable release with no recent updates. It supports any framework (Vue, React, Svelte, etc.) and allows configuration of routes and per-route metadata like title, keywords, and description. Unlike other prerender solutions, it runs headless Chrome via Puppeteer and integrates directly into the Vite build pipeline. The plugin is lightweight but lacks TypeScript definitions and has limited documentation.

npm install vite-plugin-prerenderer
INSTALL
IMPORT
SIG · VITE-PLUGIN-PREREN
V
vite-plugin-prerenderer
web-frameworkjavascriptv1.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

vitePluginPrerenderer
✓ import vitePluginPrerenderer from 'vite-plugin-prerenderer'
✗ const vitePluginPrerenderer = require('vite-plugin-prerenderer')
Default export, ESM only (no CommonJS export)
default
✓ import vitePluginPrerenderer from 'vite-plugin-prerenderer'
✗ import { default } from 'vite-plugin-prerenderer'
Use default import syntax, not named import
Config
✓ import type { Config } from 'vite-plugin-prerenderer'
TypeScript users can import Config type (if available, but plugin has no types)

Shows basic setup: import plugin, configure routes with optional per-route metadata.

// vite.config.js import { defineConfig } from 'vite'; import vitePluginPrerenderer from 'vite-plugin-prerenderer'; export default defineConfig({ plugins: [ vitePluginPrerenderer({ routes: ['/', '/about', '/contact'], options: { '/': { title: 'Home', keyWords: ['vite', 'prerender'], description: 'Home page' }, '/about': { title: 'About', description: 'About us' }, }, }), ], });
Debug
Known issues
gotchaPuppeteer must be installed separately or you will get a runtime error.
fix
Install puppeteer as a dev dependency: `npm install puppeteer -D`.
affects: >=0.0.0
breakingPlugin uses Puppeteer under the hood; it may fail in serverless or CI environments without headless Chrome.
fix
Use puppeteer-core with a pre-installed Chrome binary, or run in an environment with Chrome available.
affects: >=0.0.0
deprecatedThe plugin's configuration does not allow customizing Puppeteer launch options (e.g., headless mode, args).
fix
None, as the plugin does not expose this.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Failed to launch the browser process! Puppeteer v22.1.0
Puppeteer not installed or Chrome executable not found.
fix
Run `npx puppeteer browsers install chrome` or install puppeteer with `npm install puppeteer`.
TypeError: vitePluginPrerenderer is not a function
Plugin imported incorrectly (e.g., named import instead of default).
fix
Use: `import vitePluginPrerenderer from 'vite-plugin-prerenderer'`
ReferenceError: require is not defined in ES module scope
Using require() in an ESM project.
fix
Switch to `import vitePluginPrerenderer from 'vite-plugin-prerenderer'`
Error: The route '/' is not defined in options.
Options object does not have a key for a route listed in routes array.
fix
Ensure all routes have an entry in options if you provide options; or omit options entirely if not needed.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
puppeteeroptionalPuppeteer is used to render pages headlessly
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
vite-plugin-prerenderer — npm install vite-plugin-prerenderer · libregistry