Drop a .svelte file in a Hono Worker.
That's it.
Real Svelte 5. Real SSR. Real hydration. No SvelteKit, no Vite, no scaffolding. Just one middleware, one route helper, one build step.
The whole worker
import { Hono } from "hono";
import { svelteRenderer, attachSvelteRoutes } from "hono-svelte";
import Hello from "./hello.svelte";
declare const __HONO_SVELTE_BUNDLES__: Record<string, { js: string; css: string }>;
const app = new Hono();
attachSvelteRoutes(app, { bundles: __HONO_SVELTE_BUNDLES__ });
app.get(
"/",
svelteRenderer(Hello, {
hydrateAs: "hello",
title: "Hello",
props: { initialCount: 0 },
}),
);
export default app; This page is the receipt โ you're reading it. The site you're on is built with hono-svelte. Why this exists โ
What you get
- SSR first paint. The HTML is real, server-rendered Svelte. No blank flash.
- Hydration after. Click handlers,
$state,$effectall work. - One build step.
buildHonoSvelte()handles both passes. - Cache API built in. Both HTML and client bundles use Cloudflare's
caches.default. Second request per PoP returns from cache without re-rendering. - Cloudflare Workers native. No
eval, nonew Function, no codegen. - ~5 KB library + your component bundle.