sv create my-app
to create a SvelteKit project with SvelteKit CLI. Answer the prompts to select a template and set up your development environment.
terminal
Once the project is initialized,
cd
into the new project. You don’t need to run ‘bun install’ since the dependencies are already installed.
Then start the development server with bun --bun run dev
.
To run the dev server with Node.js instead of Bun, you can omit the --bun
flag.
terminal
Visit http://localhost:5173 in a browser to see the template app.
If you edit and save
src/routes/+page.svelte
, you should see your changes hot-reloaded in the browser.
To build for production, you’ll need to add the right SvelteKit adapter. Currently we recommend the
bun add -D svelte-adapter-bun
.
Now, make the following changes to your svelte.config.js
.
svelte.config.js
To build a production bundle:
terminal