1. Production
  2. Deploying

Production

Deploying

The default adapter by SvelteKit will automatically build the correct ouput based on the deployment environment (i.e., Vercel, Netlify, etc.). Follow the instructions below if you'd like to configure static deployments.

Static Builds

terminal
        npm i @sveltejs/adapter-static -D

      
svelte.config.js
        - import adapter from '@sveltejs/adapter-auto';
+ import adapter from '@sveltejs/adapter-static';

      

Finally, use the following settings when creating your project with your chosen deployment provider:

  • Install Command: npm i
  • Build Command: npm run build
  • Output Directory: build

Vercel

Add the following to the root of your project inside a vercel.json file:

vercel.json
        {
  "cleanUrls": true
}

      

Netlify

Add the following to the root of your project inside a netlify.toml file:

netlify.toml
        [build]
  publish = "build/"
  command = "npm run build"

[build.processing.html]
  pretty_urls = true