@sveltejs/adapter-vercel adapter deploys your SvelteKit app to Vercel.
Installation
Usage
Add the adapter to yoursvelte.config.js:
Configuration options
From the adapter type definitions:runtime
The runtime to use for your app. Can be a Node.js version or'edge'.
regions
An array of Vercel Edge Network regions where your app will be deployed.maxDuration
Maximum execution duration in seconds for serverless functions. Available on Pro and Enterprise plans.memory
Amount of memory (in MB) allocated to serverless functions.split
Iftrue, each route will be deployed as a separate function. Useful for large apps to stay within function size limits.
isr
Incremental Static Regeneration configuration. Only works with serverless functions.ISR requires a serverless runtime. It does not work with edge functions.
images
Configuration for Vercel Image Optimization:Per-route configuration
You can export aconfig object from +page.server.js or +server.js files to configure individual routes:
Build output
The adapter generates a.vercel/output directory:
Platform object
Vercel provides platform-specific context viaevent.platform:
Environment variables
Vercel provides several automatic environment variables:
Access them in your app:
Deployment
1
Build your app
2
Deploy to Vercel
Skew protection
Vercel automatically enables skew protection to prevent version mismatches:Cron jobs
Vercel supports scheduled functions viavercel.json: