This guide explains how to configure your plugin to use [Svelte](https://svelte.dev/), a light-weight alternative to traditional frameworks like React and Vue. Svelte is built around a compiler that preprocesses your code and outputs vanilla JavaScript, which means it doesn't need to load any libraries at run time. This also means that it doesn't need a virtual DOM to track state changes, which allows your plugin to run with minimal additional overhead. If you want to learn more about Svelte, and how to use it, refer to the [tutorial](https://svelte.dev/tutorial/basics) and the [documentation](https://svelte.dev/docs). This guide assumes that you've finished [[Build a plugin]]. > [!tip] Visual Studio Code > Svelte has an [official Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) that enables syntax highlighting and rich IntelliSense in Svelte components. ## Configure your plugin To build a Svelte application, you need to install the dependencies and configure your plugin to compile code written using Svelte. 1. Add Svelte to your plugin dependencies: ```bash npm install --save-dev svelte svelte-preprocess @tsconfig/svelte esbuild-svelte ``` 2. Extend the `tsconfig.json` to enable additional type checking for common Svelte issues. The `types` property is important for TypeScript to recognize `.svelte` files. ```json { "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { "types": ["svelte", "node"], // ... } } ``` 3. Remove the following line from your `tsconfig.json` as it conflicts with the Svelte configuration. ```json "inlineSourceMap": true, ``` 4. In `esbuild.config.mjs`, add the following imports to the top of the file: ```js import esbuildSvelte from "esbuild-svelte"; import sveltePreprocess from "svelte-preprocess"; ``` 5. Add Svelte to the list of plugins. ```js esbuild .build({ plugins: [ esbuildSvelte({ compilerOptions: { css: true }, preprocess: sveltePreprocess(), }), ], // ... }) .catch(() => process.exit(1)); ``` ## Create a Svelte component In the root directory of the plugin, create a new file called `Component.svelte`: ```tsx