diff --git a/packages/bun-plugin-svelte/README.md b/packages/bun-plugin-svelte/README.md
index b599c9ecb0..217d1d8cd3 100644
--- a/packages/bun-plugin-svelte/README.md
+++ b/packages/bun-plugin-svelte/README.md
@@ -8,7 +8,7 @@ The official [Svelte](https://svelte.dev/) plugin for [Bun](https://bun.sh/).
## Installation
```sh
-bun add -D bun-plugin-svelte
+$ bun add -D bun-plugin-svelte
```
## Dev Server Usage
@@ -16,52 +16,25 @@ bun add -D bun-plugin-svelte
`bun-plugin-svelte` integrates with Bun's [Fullstack Dev Server](https://bun.sh/docs/bundler/fullstack), giving you
HMR when developing your Svelte app.
-```html
-
-
-
-
-
-
-
-
-
+Start by registering it in your [bunfig.toml](https://bun.sh/docs/runtime/bunfig):
+
+```toml
+[serve.static]
+plugins = ["bun-plugin-svelte"]
```
-```ts
-// index.ts
+Then start your dev server:
-import { mount, unmount } from "svelte";
-import App from "./App.svelte";
-
-// mount the application entrypoint to the DOM
-const root = document.getElementById("root")!;
-const app = mount(App, { target: root });
+```
+$ bun index.html
```
-```svelte
-
-
-
-
-
-
Cookin up apps with {name}
-
-
-
-```
+See the [example](https://github.com/oven-sh/bun/tree/main/packages/bun-plugin-svelte/example) for a complete example.
## Bundler Usage
+`bun-plugin-svelte` lets you bundle Svelte components with [`Bun.build`](https://bun.sh/docs/bundler).
+
```ts
// build.ts
// to use: bun run build.ts
@@ -70,7 +43,7 @@ import { SveltePlugin } from "bun-plugin-svelte"; // NOTE: not published to npm
Bun.build({
entrypoints: ["src/index.ts"],
outdir: "dist",
- target: "browser", // use "bun" or "node" to use Svelte components server-side
+ target: "browser",
sourcemap: true, // sourcemaps not yet supported
plugins: [
SveltePlugin({
diff --git a/packages/bun-plugin-svelte/example/App.svelte b/packages/bun-plugin-svelte/example/App.svelte
new file mode 100644
index 0000000000..a73279986b
--- /dev/null
+++ b/packages/bun-plugin-svelte/example/App.svelte
@@ -0,0 +1,311 @@
+
+
+
+