Socket
Book a DemoInstallSign in
Socket

bun-plugin-svelte

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-plugin-svelte

Official Svelte plugin for Bun

0.0.6
latest
Source
npmnpm
Version published
Weekly downloads
117
-32.37%
Maintainers
2
Weekly downloads
 
Created
Source

Logo

bun-plugin-svelte

The official Svelte plugin for Bun.

Installation

$ bun add -D bun-plugin-svelte

Dev Server Usage

bun-plugin-svelte integrates with Bun's Fullstack Dev Server, giving you HMR when developing your Svelte app.

Start by registering it in your bunfig.toml:

[serve.static]
plugins = ["bun-plugin-svelte"]

Then start your dev server:

$ bun index.html

See the example for a complete example.

Bundler Usage

bun-plugin-svelte lets you bundle Svelte components with Bun.build.

// build.ts
// to use: bun run build.ts
import { SveltePlugin } from "bun-plugin-svelte"; // NOTE: not published to npm yet

Bun.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

FAQs

Package last updated on 26 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.