SvelteKit Local Development Guide

SvelteKit is the full-stack framework for Svelte, supporting SSR and static exports, with local development defaulting to localhost:5173.


SvelteKit is the official application framework for Svelte, providing file routing, server-side loading, adapter deployment, and an excellent development experience, with compile-time optimizations resulting in a smaller runtime size.

Quick Start

npm create svelte@latest my-app
cd my-app
npm install
npm run dev

Default localhost Access

PurposeAddress
Development Serverhttp://localhost:5173
Preview Production Buildhttp://localhost:4173

Common Commands

CommandDescription
npm run devDevelopment mode
npm run buildProduction build
npm run previewPreview build results

Rendering Modes

  • SSR: Supported by default, beneficial for SEO
  • SSG: Pre-rendered static pages
  • CSR: Configurable pure client-side pages

Choose deployment targets through adapter-static, adapter-node, adapter-cloudflare, etc.

Summary

SvelteKit is suitable for full-stack projects that prioritize performance and concise syntax; local development can be accessed at http://localhost:5173.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run