TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/webviewjs/webview/llms.txt
Use this file to discover all available pages before exploring further.
webview CLI tool packages your application into a single self-contained executable. Once built, the binary requires no Node.js, Deno, or Bun installation on the target machine — the runtime is bundled inside. The CLI auto-detects which runtime is currently executing it and uses that as the default, so running webview --build from inside a Bun project will use Bun’s compiler without any extra flags.
Quick Start
Install the CLI
The
webview binary is included in the @webviewjs/webview package. Install it globally or use npx.Build your application
Point
--input at your entry file and give the output binary a --name. The CLI writes to dist/ by default.Choosing a Runtime
The CLI supports three runtimes selected with--runtime (-R). If you omit the flag, the CLI detects the runtime it is currently running under: Bun → bun, Deno → deno, otherwise node.
| Runtime | Flag | Compiler used |
|---|---|---|
| Node.js (default) | --runtime node | Node.js Single Executable Application (SEA) |
| Deno | --runtime deno | deno compile |
| Bun | --runtime bun | bun build --compile |
CLI Flags Reference
Node.js SEA: How It Works
The Node.js runtime does not have a singlecompile command. The CLI automates the multi-step Single Executable Application workflow:
Write sea-config.json
The CLI writes a
sea-config.json into the output directory pointing at your entry file and listing any bundled asset blobs.Copy the Node binary
Copies the current
node executable into the output directory under your chosen name.Remove the existing signature
On macOS uses
codesign --remove-signature; on Windows uses signtool remove. Required before injection.Inject the blob
Uses
postject (fetched automatically via npx --yes postject) to embed the blob into the binary.Bundling Assets with —resources (Node.js only)
The--resources flag accepts a path to a JSON file that maps asset names to source file paths. These assets are embedded inside the SEA blob and readable at runtime via node:sea.
assets.json
node:sea API:
The
--resources flag is only supported for the node runtime. Deno and Bun have their own asset-bundling mechanisms (Deno.readFile with a --include flag, or Bun’s built-in bundler).Dry Run Mode
Pass--dry-run (-d) to preview what the CLI would do without actually running any commands or writing any files. Useful for verifying paths before a real build.
Output Directory Structure
After a successful build thedist/ directory contains:
- Node.js
- Deno
- Bun
sea-config.json, sea-prep.blob) are left in place so you can inspect them or re-run individual SEA steps manually if needed. They are not required to run the final binary.
Platform Notes
| Platform | Node SEA | Deno compile | Bun compile |
|---|---|---|---|
| Windows | ✅ .exe appended automatically | ✅ .exe appended automatically | ✅ .exe appended automatically |
| macOS | ✅ Ad-hoc signed with codesign -s - | ✅ Ad-hoc signed automatically | ✅ Sign manually after build |
| Linux | ✅ No signing needed | ✅ | ✅ |
Code Signing for Distribution
macOS signing details
macOS signing details
The CLI signs the Node.js SEA binary with
codesign --sign - (an ad-hoc identity). For App Store or notarized distribution you must re-sign with your Developer ID certificate after the build:Windows signing details
Windows signing details
The CLI calls
signtool sign /fd SHA256 <binary> if signtool is available on PATH. Failures are logged as warnings but do not abort the build. For distribution, sign with your code-signing certificate:Cross-compilation
Cross-compilation
- Node SEA does not support cross-compilation. Build on the target OS.
- Deno: pass
--targetdirectly todeno compile. Use a custom build script rather than the webviewjs CLI when targeting a different OS. - Bun: pass
--targettobun build. Same recommendation — use a custom script for cross-compile targets.