vite-plugin-ssr has been renamed Vike, see migration guide.


See Guides > Pre-rendering (SSG) for an overview of how to pre-render our app.

By default, pre-rendering is disabled. To enable it:

// vite.config.js

import { ssr } from 'vite-plugin-ssr/plugin'

export default {
  plugins: [
      // Use the default pre-render config:
      prerender: true
      // Deviate from the default pre-render config:
      prerender: {
        partial?: boolean
        noExtraDir?: boolean
        parallel?: boolean | number
        disableAutoRun?: boolean


Optional, default value: false.

Allow only some of our pages to be pre-rendered.

This setting doesn't affect the pre-rendering process: it merely suppresses the warnings when some of our pages cannot be pre-rendered.

As explained in Guides > Pre-rendering (SSG), if we don't pre-render all pages, then we need a production server. By using vite-plugin-vercel, we can still statically deploy our pre-rendered pages while using a production server for our non-pre-rendered pages.

vite-plugin-ssr shows a warning that a page cannot be pre-rendered, when the page has a parameterized route (e.g. a Route String /movie/@movieId, or a Route Function), and there isn't any prerender() hook that provides at least one URL matching the page's route (e.g. /movie/42).


Optional, default value: false.

Don't create a new directory for each HTML file.

For example, generate dist/client/about.html instead of dist/client/about/index.html.

Generating a directory for each HTML file is the most reliable way for telling Static Hosts the static URL of each static HTML. But some static hosts prefer the other way.


Optional, default value: os.cpus().length.

Number of concurrent pre-render jobs.

Set to false (or 1) to disable concurrency.

The default value is the fastest, but it may induce high spikes of memory usage.

Disable concurrency if:

  • You encounter JavaScript heap out of memory errors.
  • If pre-rendering takes an abnormal high amount of time. (Caused by the very slow process of memory swapping that kicks-in when memory starts to saturates).


Optional, default value: false.

Disable the automatic initiation of the pre-rendering process when running $ vite build.

Use this if you want to programmatically initiate the pre-rendering process instead.

See API > prerender() programmatic.