Svelte
npm install @kadal/deck-svelte svelte @sveltejs/vite-plugin-sveltepnpm add @kadal/deck-svelte svelte @sveltejs/vite-plugin-svelteyarn add @kadal/deck-svelte svelte @sveltejs/vite-plugin-sveltebun add @kadal/deck-svelte svelte @sveltejs/vite-plugin-svelte// vite.config.ts: deckSveltePlugin runs `enforce: "post"`, after svelte()import { deckSveltePlugin } from "@kadal/deck-svelte/build";import { svelte } from "@sveltejs/vite-plugin-svelte";
plugins: [ deck({ entry: "deck.mdx" }), react(), svelte({ compilerOptions: { runes: true } }), deckSveltePlugin(),];registerLazyRenderer("svelte", () => import("@kadal/deck-svelte").then((m) => m.svelteRenderer));import { Island } from "@kadal/deck";
<Island load={() => import("/src/chart.svelte")} props={{ data: [3, 1, 4] }} client="slide" />No framework="svelte", and no stamp written by hand: that is the plugin’s whole job.
Why the build has to say so
Section titled “Why the build has to say so”A production Svelte component is export default function Probe($$anchor, $$props) — a two-argument
function with nothing in it that says Svelte. So the renderer has no owns() at all, and
deckSveltePlugin() appends a stamp (Symbol.for("deck.renderer") = "svelte") to each compiled
module instead. The stamp survives minification.
Props need a compiler. Svelte’s $state exists only in files the Svelte compiler sees, so the
renderer’s reactive props bag lives in a .svelte.ts companion module compiled by your Svelte plugin.
That is why the plugin is required, not optional.