How to deploy a SvelteKit application to Vercel
Things you’ll need:
- a SvelteKit project
- a Vercel account
- Vercel CLI
Instructions:
Set up your SvelteKit project:
- Create a new SvelteKit project.
pnpm create svelte sveltekitchen
Follow the prompts.
Navigate to the project directory.
cd sveltekitchen
- Install project dependencies.
pnpm i
Create a Vercel account:
- Sign up for a Vercel account at https://vercel.com/ if you don’t have one already.
Install the Vercel CLI:
- Install the Vercel CLI globally on your machine.
pnpm i -g vercel
- Log in to Vercel using the CLI.
vercel login
- Follow the prompts.
Deploy to Vercel:
- Initiate the deployment process.
vercel
Follow the prompts and provide the requested information, such as the project path, deployment name, and build command.
Once the deployment process is complete, Vercel will provide you with a deployment URL.
Serve and enjoy:
- Visit the provided deployment URL to access your deployed SvelteKit application.
Notes
Recipe tested using:
- @sveltejs/adapter-auto@2.1.0
- @sveltejs/kit@1.20.5
- svelte@4.0.0
- vite@4.3.9
- vercel@30.2.3