Skip to main content
The WebviewJS CLI’s --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 the webview 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.
The executable is written to 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 compiles via the Single Executable Application (SEA) workflow. The CLI generates the SEA blob, injects it with 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.
The build invokes npx postject and the platform signing tools described above.

All CLI options

Run --dry-run before a real build to preview the selected input, output, and runtime without invoking the compiler. It validates the runtime name and prints a summary; it does not check that files exist or print each compiler command.

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
Pass the file to the CLI:
Inside your script, read the embedded assets with the node:sea API:
Asset bundling is only available with the Node.js runtime. Deno and Bun do not use the --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.

  • Installation — system requirements and first-time setup
  • Quick Start — build and run your first WebviewJS window