Vite adapter for Vercel that bundles applications according to the Vercel Output API. Version 11.0.3 requires Vite >=7.1. Supports SSG/static files, SSR/serverless functions with auto-bundling from the api folder, ISR/prerender functions, Edge functions and Edge middleware. Differentiates from @vercel/build by not forcing api folder builds, offering flexible endpoint mapping via getVercelEntries and per-endpoint configuration (edge, headers, streaming, isr). Actively maintained with frequent releases.
npm install vite-plugin-vercelVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config with Vercel plugin, endpoint mapping via getVercelEntries, and a sample API route.
Upgrade Vite to >=7.1 or stay on v10.x
Use `import vercel from 'vite-plugin-vercel'` instead of `import createVercel`
Move API files to a custom folder (e.g., endpoints/api) and configure entries accordingly.
Use getVercelEntries to define endpoints programmatically.
Ensure edge function handlers return Response and set streaming flag if needed.
Switch to ESM by using import statements or set "type": "module" in package.json.
Run npm install -D vite-plugin-vercel (or equivalent with yarn/pnpm/bun).
Use `import vercel from 'vite-plugin-vercel'` (default import).
Increase defaultMaxDuration in plugin options or optimize function code.
Use `import { getVercelEntries } from 'vite-plugin-vercel'` in an ESM context.