@guren/plugin-vercel
v0.2.1
Published
Deploy a [Guren](https://guren.dev/) SSR application to Vercel. The plugin assembles a [Build Output API v3](https://vercel.com/docs/build-output-api/v3) directory that runs on Vercel's Bun runtime.
Readme
@guren/plugin-vercel
Deploy a Guren SSR application to Vercel. The plugin assembles a Build Output API v3 directory that runs on Vercel's Bun runtime.
bunx guren plugin @guren/plugin-vercel
bun add @guren/plugin-vercelInstalling scaffolds src/vercel.ts, scripts/vercel-build.ts, and vercel.json.
Build and deploy
bun run vercel:build
vercel deploy --prebuiltAPI
createVercelHandler(app)— boots a GurenApplicationand returns afetchhandler for the serverless function.// src/vercel.ts import app from './app.js' import { createVercelHandler } from '@guren/plugin-vercel' export default await createVercelHandler(app)buildVercelOutput(options)— assembles.vercel/output: the bundled function, static assets, and the routing config. Reads the Vite manifests to inject the correctGUREN_INERTIA_*environment variables into the function.vercelPlugin()— the service provider factory, registered automatically byguren plugin.
Notes
- SSR apps only. The plugin reads Vite manifests to wire the Inertia SSR bundle. API-only apps should use Docker or Lambda instead.
- SSR bundles must be self-contained. Function directories ship without
node_modules, so externalizedreact/@inertiajs/reactimports fail at runtime and Inertia silently falls back to client-side rendering. The Guren Vite plugin defaultsssr.noExternal: truefor SSR builds — leave it alone unless you know the target has those packages installed. NODE_ENVis inlined at bundle time.bun buildbakes in"development"unless told otherwise, and a runtimeNODE_ENV=productioncannot override it. This plugin passes the right--definefor you.
See the deployment guide for the full setup.
License
MIT
