sveltejs/svelte
Svelte
What is Svelte?
Svelte is a compiler that turns declarative .svelte components into small, efficient JavaScript that updates the DOM directly, without a virtual DOM. Source code lives in a single npm-publishable package, packages/svelte, inside this monorepo. The repo currently ships Svelte 5 (current version 5.55.5, see packages/svelte/src/version.js).
A Svelte component file contains three things — a <script> block, markup, and a <style> block. The compiler reads them, performs analysis, and emits a JavaScript module per component plus optional scoped CSS. The same input also has a server target that produces an HTML string for SSR.
Who uses it
- Application authors building web apps directly with Svelte components (typically through SvelteKit).
- Tooling authors integrating Svelte with bundlers via
svelte/compiler(vite-plugin-svelte,rollup-plugin-svelte, etc.). - Library authors publishing reusable
.sveltecomponents.
Repo layout
sveltejs/svelte/
├── packages/
│ └── svelte/ # the published `svelte` package
│ ├── src/
│ │ ├── compiler/ # parser, analyzer, transformer
│ │ ├── internal/ # client + server runtimes
│ │ ├── reactivity/ # Map, Set, Date, URL etc. wrappers
│ │ ├── transition/, animate/, motion/, easing/
│ │ ├── attachments/, events/, store/, legacy/, server/
│ │ └── index-client.js / index-server.js
│ ├── tests/ # vitest test suites (40+ areas)
│ └── messages/ # human-readable error/warning sources
├── playgrounds/ # local dev sandboxes
├── benchmarking/ # NODE_ENV=production microbenchmarks
├── documentation/docs/ # canonical docs that sync to svelte.dev
└── pnpm-workspace.yaml # monorepo declarationQuick links
- Architecture — how compiler, runtime, and reactivity fit together
- Getting started — install, build, test commands
- Glossary — domain vocabulary used across this wiki
- Compiler — parse → analyze → transform pipeline
- Client runtime — DOM blocks, effects, mount/hydrate
- Reactivity engine — sources, deriveds, effects, batches
- How to contribute
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.