From 4f521577a16cc5236acf9eff51c8c79c098ba156 Mon Sep 17 00:00:00 2001 From: Luna <279187109+lunadogbot@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:45:27 +0000 Subject: [PATCH] docs: document framework detection for `deno compile` (2.8) Adds a "Framework detection" section to compile.md describing the new behavior: \`deno compile .\` (or a directory) detects Next.js, Astro, Fresh 1.x/2.x, Remix, SvelteKit, Nuxt, SolidStart, TanStack Start, and Vite SSR projects, runs \`deno task build\` first, and generates the entrypoint automatically. Notes that the entrypoint uses \`import.meta.dirname\` so framework asset paths resolve against the VFS. Refs denoland/deno#33164 --- runtime/reference/cli/compile.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/runtime/reference/cli/compile.md b/runtime/reference/cli/compile.md index 4a164615d..913a6f50e 100644 --- a/runtime/reference/cli/compile.md +++ b/runtime/reference/cli/compile.md @@ -30,6 +30,41 @@ deno compile --allow-read --allow-net jsr:@std/http/file-server -p 8080 ./file_server --help ``` +## Framework detection + +Starting in Deno 2.8, `deno compile .` (or `deno compile `) detects +common web frameworks and produces an entrypoint that knows how to start them. +The detected build script is run via `deno task build` first, so the compiled +binary always contains a fresh build. + +Supported frameworks: + +- Next.js +- Astro +- Fresh (1.x and 2.x) +- Remix +- SvelteKit +- Nuxt +- SolidStart +- TanStack Start +- Vite (SSR mode) + +```sh +# In a Next.js / Astro / Fresh / etc. project +deno compile . + +# Or pointing at a specific app directory +deno compile ./apps/web +``` + +Generated entrypoints use `import.meta.dirname` so framework asset paths +resolve correctly against the +[virtual filesystem](#including-data-files-or-directories) inside the compiled +binary. + +If the project doesn't match any supported framework, `deno compile` errors +out — pass an explicit entrypoint file in that case. + ## Cross Compilation You can cross-compile binaries for other platforms by using the `--target` flag.