--build command delegates to the selected runtime’s executable compiler. The resulting executable includes the chosen runtime and your application code, but the WebviewJS native addon remains platform-specific and the target still needs its native webview prerequisites. The CLI is not an installer, package manager, or full application bundler.
It does not add the matching platform-specific WebviewJS .node addon to the executable for you, so make that addon available to the built application when you distribute it.
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 generates the SEA blob, injects it with The build invokes
postject, and invokes
codesign --sign - on macOS or tries signtool on Windows. Windows signing
failures are reported as warnings; macOS signing failures can stop the
build. Signing still depends on the platform tools and credentials available
on the build machine.npx postject and the platform signing tools described
above.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:
--resources option; use their runtime-specific packaging behavior.
Platform notes
Cross-compilation:
- The WebviewJS CLI does not provide cross-compilation. Build on the target operating system and architecture, or prepare the matching WebviewJS native addon and runtime toolchain manually before packaging.
Related pages
- Installation — system requirements and first-time setup
- Quick Start — build and run your first WebviewJS window