Development GuideOverview

Development guide

A svelte-d application is, on disk, a perfectly ordinary bun + SvelteKit tree. It has src/routes, it has src/lib, it may have public/ and some SCSS. What makes it a svelte-d application is a one-field config file and a pair of script languages that the official Svelte toolchain does not expect to see together.

// svelte-d.config.ts
export default { workspace: './svelte-engine-ws' }

That file is how the compiler finds the dest. Without it, svelte-d still looks for a kit project (src/routes) and drops svelte-engine-ws next to it. With it, the dest is explicit and survives being invoked from a subdirectory. Put it at the project root, not inside the workspace and not inside node_modules.

Scripts inside .svelte files are lang="d" for anything that must become libwasm, and optionally lang="ts" for anything that must become jsExports on the Vite side (and __svelteD.ts so D can call them). Server files are +page.server.d and +server.d. There is no v1 +page.ts universal load; that is a diagnostic, not a silent Node implementation. The host cell is vibe.0, and pretending otherwise is how a second HTTP stack appears.

The rest of this guide is ordered as you will actually work. Example: admin panel is a complete, copyable project — the kit-admin fixture reduced to a layout, a dashboard, a list, and a param page, with JSON instead of Postgres. script lang=“d” is the contract for the wasm cell. SvelteKit routes is how files become URLs and how layouts stay mounted. lang=ts splice, cross-calling, config, extensions, host files, and dev / HMR fill in the rest of a working day.

Do not skip from the admin example to {#each}{#if row.ok && !on} without reading Svelte → D IR. The printer will emit something for a construct it knows; the language section is how you know whether that something is the idiom you meant. The two cells that idiom compiles against are libwasm and vibe.0.