Getting started
We recommend using SvelteKit, which lets you build almost anything. It’s the official application framework from the Svelte team and powered by Vite. Create a new project with:
npx sv create myapp
cd myapp
npm install
npm run dev
Don’t worry if you don’t know Svelte yet! You can ignore all the nice features SvelteKit brings on top for now and dive into it later.
Alternatives to SvelteKit
You can also use Svelte directly with Vite by running npm create vite@latest
and selecting the svelte
option. With this, npm run build
will generate HTML, JS, and CSS files inside the dist
directory using vite-plugin-svelte. In most cases, you will probably need to choose a routing library as well.
Vite is often used in standalone mode to build single page apps (SPAs), which you can also build with SvelteKit.
There are also plugins for Rollup, Webpack and a few others, but we recommend Vite.
Editor tooling
The Svelte team maintains a VS Code extension, and there are integrations with various other editors and tools as well.
You can also check your code from the command line using sv check.
Getting help
Don’t be shy about asking for help in the Discord chatroom! You can also find answers on Stack Overflow.