-
In the
package.jsonfile using thebuildkey: -
Through the
--config <path/to/yml-or-json5-or-toml-or-js>option (defaults toelectron-builder.yml):
Supported formats:
json, json5, toml, yaml, and js/ts (exported configuration or function)Configuration Methods
package.json Configuration
electron-builder.yml Configuration
JavaScript Configuration
Environment Variables
You can use anelectron-builder.env file in the current directory for environment variables. This is supported only for CLI usage.
Common Configuration Options
The application id. Used as:
- CFBundleIdentifier for macOS
- Application User Model ID for Windows (NSIS target only)
The product name for your executable. Can contain spaces and special characters not allowed in the
name property.If not specified in build configuration, the top-level productName from package.json is used. If that’s not specified, the name property is used.The human-readable copyright line for the app.
Directories for build resources and output.
The path to build resources (icons, background images, etc.).
Build resources are not packed into the app. If you need to use files at runtime (e.g., tray icon), include them explicitly using the
files option.The output directory. Supports file macros.
The application directory containing the application package.json. Defaults to
app, www, or working directory.The build version. Maps to:
CFBundleVersionon macOSFileVersionmetadata property on Windows
version from package.json.If not defined but buildNumber is defined, it will be set to version.buildNumber.The build number. Maps to the
--iteration flag for builds using FPM on Linux.If not defined, falls back to environment variables:BUILD_NUMBERTRAVIS_BUILD_NUMBERAPPVEYOR_BUILD_NUMBERCIRCLE_BUILD_NUMBUILD_BUILDNUMBERCI_PIPELINE_IID
The version of Electron you are packaging for. Defaults to the version of
electron, electron-prebuilt, or electron-prebuilt-compile dependency.Inject properties to
package.json. Useful for setting version or other metadata dynamically.The name of a built-in configuration preset (currently only
react-cra is supported) or paths to config files.Allows mixing configs from multiple files, properly combining files glob patterns.If react-scripts is in app dependencies, react-cra is set automatically. Set to null to disable.Native Dependencies
Whether to build the application native dependencies from source.
Whether to execute
node-gyp rebuild before starting to package the app.Whether to rebuild native dependencies before starting to package the app.
Use
legacy app-builder binary for installing native dependencies, or @electron/rebuild in sequential or parallel compilation modes.Options: legacy, sequential, parallelAdditional command line arguments to use when installing app native dependencies.
Code Signing
Whether to fail if the application is not signed (prevents unsigned app if code signing configuration is incorrect).
Advanced Options
The electron-download options.
The branding used by Electron’s distributables. Needed if a fork has modified Electron’s BRANDING.json file.
Whether to download the alternate FFmpeg library from Electron’s release assets and replace the default FFmpeg library prior to signing.
Whether to include PDB files (Windows debugging symbols).
Whether to remove
scripts field from package.json files.Whether to remove
keywords field from package.json files.Whether to disable sanity check of asar package. Useful for custom Electron forks that implement their own encrypted integrity validation.
Electron Fuses
Options to pass to @electron/fuses. Fuses are security and feature toggles in Electron.
Toggles whether the
ELECTRON_RUN_AS_NODE environment variable is respected.If disabled,
process.fork won’t work as expected. Use Utility Processes instead.Toggles whether the cookie store on disk is encrypted using OS level cryptography keys.
Toggles whether the
NODE_OPTIONS and NODE_EXTRA_CA_CERTS environment variables are respected.Toggles whether the
--inspect, --inspect-brk, etc. flags are respected.Toggles validation of the
app.asar file content when loaded.Supported on:- macOS (Electron >= 16.0.0)
- Windows (Electron >= 30.0.0)
Changes the search order to only load from
app.asar. Ensures only validated code is loaded when combined with enableEmbeddedAsarIntegrityValidation.Changes which V8 snapshot file is used for the browser process (
browser_v8_context_snapshot.bin).Toggles extra privileges for pages loaded from the
file:// protocol.Toolset Configuration
Configuration of toolsets utilized by electron-builder.
win-codesign version to use for signing Windows artifacts.Options:0.0.0(stable, winCodeSign)1.0.0(beta, Windows Kits 10.0.26100.0)1.1.0(beta)
appimage bundle version to use for AppImage packaging and runtime.Options:0.0.0(legacy toolset)1.0.2(beta, Runtime 20251108)
Concurrency
Experimental configuration for concurrent builds.
The maximum number of concurrent jobs to run.
Framework-Specific Options
Proton Native
To package Proton Native apps, setnodeVersion to current or a specific NodeJS version.
Currently, only macOS and Linux are supported for Proton Native.
The framework name. Options:
electron, proton, libui.For libui-based frameworks only. The version of NodeJS you are packaging for. Set to
current to use the Node.js version you’re running.For libui-based frameworks only. The version of LaunchUI you are packaging for (Windows only).
Build Version Management
CFBundleVersion (macOS) and FileVersion (Windows) will be set automatically to version.build_number on CI servers:
- Travis CI
- AppVeyor
- CircleCI
- Bamboo
- GitLab CI
- GitHub Actions
Overridable Options
Many options can be overridden per platform using the top-levelmac, linux, and win keys. See:
Artifact File Name Template
The${ext} macro is supported in addition to file macros for artifact naming.
Notes
Most options accept
null to explicitly unset a value. For example, to use the default OS volume icon instead of the application icon for DMG, set dmg.icon to null.