StartpodDocs

Svelte

Run Svelte 5 components with a live Vite preview.

This project uses Svelte 5 with Vite. Open App.svelte to edit the markup or the $state counter. Styles live in a separate style.css file.

Try it in the browser

The example starts automatically. Change the heading, update a CSS rule, or click the counter to see Svelte's reactive state in action.

Loading editor…

Configure Vite

Use the Svelte plugin and let Vite serve Svelte's browser modules directly:

vite.config.ts
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';

export default defineConfig({
  plugins: [svelte()],
  optimizeDeps: { exclude: ['svelte'] },
});

This is a Svelte app, not a SvelteKit project. See Quickstart for mounting files, installing dependencies, and displaying a preview.

On this page