bun-plugin-svelte lets you bundle Svelte components with Bun.build.
// build.ts// to use: bun run build.tsimport { SveltePlugin } from "bun-plugin-svelte"; // NOTE: not published to npm yetBun.build({ entrypoints: ["src/index.ts"], outdir: "dist", target: "browser", sourcemap: true, // sourcemaps not yet supported plugins: [ SveltePlugin({ development: true, // turn off for prod builds. Defaults to false }), ],});
Server-Side Usage
bun-plugin-svelte does not yet support server-side imports (e.g. for SSR).
This will be added in the near future.
Not Yet Supported
Support for these features will be added in the near future
Server-side imports/rendering
Source maps
CSS extensions (e.g. tailwind) in <style> blocks
TypeScript-specific features (e.g. enums and namespaces). If you're using
TypeScript 5.8, consider enabling --erasableSyntaxOnly