--build command packages your application into a single self-contained executable. The target machine does not need Node.js, Deno, or Bun installed — the binary includes your code and the chosen runtime. This makes it straightforward to distribute desktop applications to end users without asking them to install a JavaScript runtime first.
The CLI is available as both the
webview command and the webviewjs
command. Both are identical — use whichever name is more convenient.Install the CLI
Install the package globally to add thewebview and webviewjs commands to your PATH, or use npx for one-off builds without a global install.
Quick start
Point the CLI at your entry file, give the output binary a name, and let it build.dist/ by default. On Windows a .exe extension is added automatically.
Choosing a runtime
Use--runtime (short: -R) to select the compilation tool. When --runtime is omitted, the CLI infers the runtime from its own execution environment: bun if run under Bun, deno if run under Deno, and node otherwise. For most users running via npm or npx, the default is node.
- Node.js (default)
- Deno
- Bun
Node.js compiles via the Single Executable Application (SEA) workflow.
The CLI automates every step: generating the blob config, injecting it with No additional tools beyond
postject, and re-signing the binary on macOS and Windows.node and npx are required. postject is downloaded automatically via npx during the build.All CLI options
Bundling assets (Node.js only)
Node.js SEA supports embedding static assets in the binary via the--resources flag. Create a JSON file that maps asset names to file paths on disk.
assets.json
node:sea API:
Platform notes
Cross-compilation:
- Deno and Bun support a
--targetflag that you can pass via a custom build script for cross-compilation to a different OS or architecture. The WebviewJS CLI does not forward--targetfor you. - Node SEA does not support cross-compilation. Build on the target operating system.
Related pages
- Installation — system requirements and first-time setup
- Quick Start — build and run your first WebviewJS window