SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 30 Rust

fix(compile): detect svelte-adapter-deno build output (#34535)

Framework detection for compiling a directory mapped any SvelteKit
project whose svelte.config referenced svelte-adapter-deno to a Nitro-style
.output/server/index.mjs entrypoint. That adapter does not use Nitro; it
emits a build/ directory where build/index.js boots the server and
build/handler.js serves static assets from sibling client, static and prerendered
directories.
As a result deno compile on such a project failed with a missing .output
module, and the older workaround of compiling build/index.js directly
produced a server that returned 404 for every asset because the static
directories were never embedded in the binary.

This detects the build/index.js plus build/handler.js output shape (and
the svelte-adapter-deno config when there is no build yet) and generates a
./build/index.js entrypoint, including the build/client, build/static
and build/prerendered directories that exist so the compiled binary can
serve them.

It also disables Deno type checking for SvelteKit, the same way it is
already done for Next.js, because the adapter's bundled output references Node
types that aren't resolvable from the build and would otherwise fail type
checking.
With both changes, deno compile ./my-app just works with no extra flags.
Verified end to end against a scaffolded SvelteKit app: the resulting
binary serves the page, static files and the immutable client assets.

Fixes #26155
B
Bartek Iwańczuk committed
862d283048fd3f2df429767b5d22e4e0508bb084
Parent: 26b6458
Committed by GitHub <noreply@github.com> on 5/30/2026, 6:42:30 AM