Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions runtime/reference/cli/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <directory>`) 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.
Expand Down