Skip to main content

Command Line Interface

Edit this page on GitHub

SvelteKit projects use Vite, meaning you'll mostly use its CLI (albeit via npm run dev/build/preview scripts):

  • vite dev — start a development server
  • vite build — build a production version of your app
  • vite preview — run the production version locally

However SvelteKit includes its own CLI for creating distributable packages and initialising your project:

svelte-kit packagepermalink

svelte-kit package is currently experimental and is not subject to Semantic Versioning rules. Non-backward compatible changes may occur in any future release.

See packaging. svelte-kit package accepts the following options:

  • -w/--watch — watch files in src/lib for changes and rebuild the package

svelte-kit syncpermalink

svelte-kit sync creates the generated files for your project such as types and a tsconfig.json. When you create a new project, it is listed as the prepare script and will be run automatically as part of the npm lifecycle, so you should not ordinarily have to run this command.

previous Packaging
We stand with Ukraine. Donate → We stand with Ukraine. Petition your leaders. Show your support.