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.