Everything you need to build a Svelte project, powered by create-svelte.
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-appUse Node.js 24 and npm. With nvm, install and select the version specified in .nvmrc:
nvm install
nvm use
npm installStart a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --openTo create a production version of your app:
npm run buildYou can preview the production build with npm run preview.
The project uses @sveltejs/adapter-cloudflare for Cloudflare Pages. Configure the Pages project with:
- Build command:
npm run build - Build output directory:
.svelte-kit/cloudflare - Node.js version:
24 - Runtime compatibility flag:
nodejs_als(ornodejs_compatif already enabled)
To test the Cloudflare build locally:
npm run build
npx wrangler pages dev .svelte-kit/cloudflare --compatibility-flag=nodejs_als