svelte-hono

hello (new) world

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.

npm i svelte-hono hono svelte

The whole worker

import { Hono } from "hono";
import { svelteRenderer, attachSvelteRoutes } from "svelte-hono";
import { bundles } from "./bundles.generated";
import Hello from "./hello.svelte";

const app = new Hono();
attachSvelteRoutes(app, { 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 svelte-hono. Why this exists โ†’

What you get