Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion runtime/cli_apps/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified: 2026-06-12
last_modified: 2026-08-06
title: "Build CLI apps"
description: "Build command-line tools with Deno: read arguments and stdin, prompt the user, set exit codes, compile to a single self-contained executable, and distribute your tool."
---
Expand Down Expand Up @@ -169,6 +169,11 @@ with the usual `--allow-*` flags so it runs without prompting:
deno compile --output greet greet.ts
```

If binary size matters more than raw execution speed, you can build against the
experimental QuickJS engine instead of V8 with `--engine quickjs`. See
[choosing a JavaScript engine](/runtime/reference/cli/compile/#choosing-a-javascript-engine)
for the trade-offs.

## Embed assets in the binary

A single-file executable should stay single-file even when your tool needs data
Expand Down
9 changes: 8 additions & 1 deletion runtime/desktop/distribution.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified: 2026-06-25
last_modified: 2026-08-06
title: "Distribution"
description: "Cross-compile a deno desktop app for macOS, Windows, and Linux from one machine, and produce per-platform output formats: .app, .dmg, .exe directory, AppImage."
---
Expand Down Expand Up @@ -185,6 +185,13 @@ Cross-compiling from one OS to another requires:

Both downloads are SHA-256 verified and cached under `<deno_dir>/`.

`deno desktop` also accepts `--engine v8|quickjs`, which selects the JavaScript
engine inside the downloaded runtime library. V8 is the default; the
experimental QuickJS build is smaller but does not receive the same security
updates. See
[choosing a JavaScript engine](/runtime/reference/cli/compile/#choosing-a-javascript-engine)
for the full trade-offs.

There is **no Rust toolchain involved** in cross-compiling a desktop app. You
are not compiling Rust on the host; you are downloading prebuilt artifacts for
the target and packaging them with your code. This is the same model as
Expand Down
47 changes: 46 additions & 1 deletion runtime/reference/cli/compile.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified: 2026-06-27
last_modified: 2026-08-06
title: "deno compile"
oldUrl:
- /runtime/manual/tools/compile/
Expand Down Expand Up @@ -106,11 +106,14 @@ Deno supports cross compiling to all targets regardless of the host platform.
| OS | Architecture | Target |
| ------- | ------------ | --------------------------- |
| Windows | x86_64 | `x86_64-pc-windows-msvc` |
| Windows | ARM64 | `aarch64-pc-windows-msvc` |
| macOS | x86_64 | `x86_64-apple-darwin` |
| macOS | ARM64 | `aarch64-apple-darwin` |
| Linux | x86_64 | `x86_64-unknown-linux-gnu` |
| Linux | ARM64 | `aarch64-unknown-linux-gnu` |

`aarch64-pc-windows-msvc` (Windows on ARM) is supported starting in Deno 2.9.3.

## The denort binary

`deno compile` embeds your program into `denort` ("Deno runtime"): a stripped
Expand All @@ -128,6 +131,48 @@ To use a custom or locally built runtime as the base, set the `DENORT_BIN`
environment variable to its path. Deno also picks up a `denort` binary placed
next to the `deno` executable.

## Choosing a JavaScript engine

:::caution

`--engine quickjs` is experimental and subject to change. It landed after Deno
2.9.4, so it is available in
[canary builds](/runtime/reference/cli/upgrade/#canary-build) and in later
releases.

:::

Compiled binaries run on V8 by default. The `--engine` flag lets you build
against QuickJS instead, which produces a smaller executable:

```sh
# Default, same as omitting the flag
deno compile --engine v8 main.ts

# Build a binary that runs on QuickJS
deno compile --engine quickjs main.ts
```

The same flag is available on [`deno desktop`](/runtime/desktop/distribution/),
where it selects the engine embedded in the app's runtime library.

Trade-offs to weigh before shipping a QuickJS binary:

- **Security updates.** The QuickJS backend does not receive the same security
updates as V8. Don't use it for programs that run untrusted input.
- **Performance.** QuickJS is an interpreter with no JIT, so compute-heavy code
runs slower than on V8. Startup and memory use are lower.
- **Maturity.** The backend is experimental; behavior differences from V8 are
possible, so test your program with the engine you intend to ship.

Each engine has its own prebuilt runtime: with `--engine quickjs`, Deno
downloads `denort-quickjs-<target>.zip` (or `libdenort-quickjs-<target>.zip` for
`deno desktop`) instead of the default `denort-<target>.zip`. Both variants are
published for every [supported target](#supported-targets), so cross-compilation
works the same way. If you override the base runtime with `DENORT_BIN` (or a
`denort` binary next to `deno`), that binary is used as-is: `--engine` is then
ignored and Deno prints a warning.

## Icons

It is possible to add an icon to the executable by using the `--icon` flag when
Expand Down
Loading