Sample.app
Framework Guides

Svelte / SvelteKit

Deploy a Svelte or SvelteKit project to Sample.app.

SvelteKit requires the static adapter to generate deployable static files.

Deploy with SvelteKit

Install the static adapter

npm install -D @sveltejs/adapter-static

Configure the adapter

svelte.config.js
import adapter from "@sveltejs/adapter-static";

export default {
  kit: {
    adapter: adapter({
      fallback: "index.html",
    }),
  },
};

Setting fallback: 'index.html' enables SPA mode, which works with Sample.app's built-in SPA fallback for client-side routing.

Build your project

npm run build

This outputs to build/ by default.

Deploy to Sample.app

samplex deploy ./build

Plain Svelte apps (without SvelteKit) use Vite and output to dist/ by default.

Deploy with Svelte + Vite

Build your project

npm run build

Deploy to Sample.app

samplex deploy

Auto-detection finds the dist/ directory.

On this page