npx sv create:
Create a new project
Run the following command to scaffold a new SvelteKit project:The CLI will ask if you’d like to set up some basic tooling such as TypeScript, ESLint, and Prettier. Choose the options that work best for your project.
Install dependencies
If you didn’t install dependencies during project creation, run:
You can use
npm, pnpm, yarn, or bun as your package manager.Start the development server
Launch the development server:Your app will be running at http://localhost:5173. The development server features hot module replacement, so changes you make will be reflected instantly in the browser.
Two basic concepts
There are two fundamental concepts to understand:- Each page is a Svelte component — Pages are defined in
.sveltefiles that export your component - You create pages by adding files to
src/routes— The file structure determines your app’s routes
Editor setup
We recommend using Visual Studio Code with the Svelte extension, but support also exists for numerous other editors.VS Code extensions
Svelte for VS Code
Provides syntax highlighting, IntelliSense, and more for Svelte components
Svelte Intellisense
Auto-completion and type checking for Svelte files
Building for production
To create a production version of your app:Deployment
To deploy your app, you’ll need to install an adapter for your target environment. Adapters are small plugins that take the built app and prepare it for deployment to your platform of choice.Quick deployment options
- Auto (recommended)
- Node.js
- Static
- Vercel
The default adapter automatically detects your deployment platform:Works with Vercel, Netlify, Cloudflare Pages, and more.
svelte.config.js