⚠️
The vite-plugin-ssr project has been renamed Vike.
  • If you are using vite-plugin-ssr, migrate to Vike.
  • For new projects, use Vike instead of vite-plugin-ssr.
Vike itself (without extensions) is like vite-plugin-ssr: unopinionated and fully agnostic.

Config

+config.h.js files are part of the V1 design.

List of configurations defined by +config.h.js.

// +config.h.ts

// The list is also available over TypeScript
import type { Config } from 'vite-plugin-ssr/types'

export default {
  // ...
} satisfies Config

Configurations

Advanced

Most users don't need to know about these. Usually only used by vike-* packages.

Hooks

Advanced

Most users don't need to know about these. Usually only used by vike-* packages.

  • onBeforeRender: server-side (and potentially client-side) Called before the page is rendered, usually for fetching data.
  • onRenderHtml: server-side Called when page is rendered to HTML on the server-side.
  • onRenderClient: client-side Called when page is rendered on the client-side.
  • onBeforeRoute: server (and potentially client-side) Called before the URL is routed to a page.

Custom

New configurations can be created by using meta.