Unlike frameworks that interpret code in the browser, Svelte compiles your components at build time. This means your .svelte files are transformed into highly efficient JavaScript, HTML, and CSS that run directly in the browser without an extra framework runtime.
Parsing – Svelte reads your .svelte file and breaks it into <script>, <style>, and markup sections.
Analysis – It identifies reactive statements, component state, props, and event bindings.
Code generation – The compiler converts your component into optimized vanilla JavaScript functions that update the DOM directly.
CSS handling – Scoped CSS is extracted and applied so styles affect only the component they belong to.
Output – The final bundle is plain JS, HTML, and CSS with no framework runtime overhead.
In short, the Svelte compiler turns declarative components into minimal, efficient JavaScript code that manipulates the DOM directly.