An esbuild plugin to compile Svelte components during bundling. At version 0.1.1, it integrates Svelte 3 with esbuild, handling .svelte files and generating CSS as separate output. It supports preprocessors and compiler options via svelte.config.js. Compared to alternatives like rollup-plugin-svelte, this plugin is lightweight and designed for esbuild's speed. It is best suited for projects already using esbuild and needing Svelte support. Note that it only supports Svelte 3 and esbuild ^0.8. CSS handling defaults to false (esbuild manages CSS) unless overridden.
npm install esbuild-plugin-svelteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Bundles a Svelte app using esbuild with the svelte plugin, outputting a single JS bundle.
Use svelte@^3.20. If using Svelte 4+, switch to a compatible plugin (e.g., @j3w1/esbuild-plugin-svelte).
Pass { compilerOptions: { css: true } } to svelte() plugin.Downgrade esbuild to 0.8.x or use a newer fork of the plugin.
Switch to @j3w1/esbuild-plugin-svelte or @sveltejs/enhanced-img for newer esbuild versions.
npm install --save-dev esbuild-plugin-svelte
Use import svelte from 'esbuild-plugin-svelte' instead of require().
Use import svelte from 'esbuild-plugin-svelte' (no braces).