On this page

Nitro

Run Rebask with Nitro.

Install the Nitro adapter

pnpm add @rebask/nitro

Add rebaskNitro() to your Vite plugins:

import { rebaskNitro } from "@rebask/nitro"

plugins: [
  rsc(),
  react(),
  rebask(),
  rebaskNitro({
    preset: "node-server",
    serverDir: "./server",
  }),
]

rebaskNitro() accepts Nitro’s Vite plugin options. preset selects the deployment target and serverDir is where Nitro routes and middleware live.

PPR is available on the filesystem-based node-server and bun presets. Other Nitro presets run the Rebask handler without PPR.

Nitro presets such as node-server and cloudflare-pages build the server output using Nitro’s normal deployment flow.

A proxy.ts is built into a separate bundle and runs before Nitro routes and static files.

Run locally

With node-server, start the built output with:

node .output/server/index.mjs

Nitro on Vercel

With both rebaskNitro() and vercelAdapter(), a Vercel build (VERCEL=1) uses Nitro's Vercel preset with the adapter's PPR output:

plugins: [
  rsc(),
  react(),
  rebaskNitro({ serverDir: "./server" }),
  rebask(),
  vercelAdapter({ memory: 1024, maxDuration: 60, regions: ["iad1"] }),
]

The adapter options behave like this with Nitro:

OptionWith Nitro
runtime, memory, maxDuration, regionsApplied to Nitro's server function and the proxy function. Nitro's own vercel.functions settings take precedence.
imagesWorks as described in Images.
disablePrerenderWorks as described in disablePrerender, and needs a custom cacheHandler.

For per-route function settings, see Nitro's Vercel docs .