-
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
string
default:"com.electron.${name}"
The application id. Used as:
- CFBundleIdentifier for macOS
- Application User Model ID for Windows (NSIS target only)
string
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.string
default:"Copyright © year ${author}"
The human-readable copyright line for the app.
object
Directories for build resources and output.
string
default:"build"
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.string
default:"dist"
The output directory. Supports file macros.
string
The application directory containing the application package.json. Defaults to
app, www, or working directory.string
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.string
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
string
The version of Electron you are packaging for. Defaults to the version of
electron, electron-prebuilt, or electron-prebuilt-compile dependency.object
Inject properties to
package.json. Useful for setting version or other metadata dynamically.string | string[]
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
boolean
default:false
Whether to build the application native dependencies from source.
boolean
default:false
Whether to execute
node-gyp rebuild before starting to package the app.string
default:"sequential"
Use
legacy app-builder binary for installing native dependencies, or @electron/rebuild in sequential or parallel compilation modes.Options: legacy, sequential, parallelstring | string[]
Additional command line arguments to use when installing app native dependencies.
Code Signing
boolean
default:false
Whether to fail if the application is not signed (prevents unsigned app if code signing configuration is incorrect).
Advanced Options
object
The electron-download options.
object
The branding used by Electron’s distributables. Needed if a fork has modified Electron’s BRANDING.json file.
boolean
default:false
Whether to download the alternate FFmpeg library from Electron’s release assets and replace the default FFmpeg library prior to signing.
boolean
default:false
Whether to include PDB files (Windows debugging symbols).
boolean
default:true
Whether to remove
scripts field from package.json files.boolean
default:true
Whether to remove
keywords field from package.json files.boolean
default:false
Whether to disable sanity check of asar package. Useful for custom Electron forks that implement their own encrypted integrity validation.
Electron Fuses
object
Options to pass to @electron/fuses. Fuses are security and feature toggles in Electron.
boolean
Toggles whether the
ELECTRON_RUN_AS_NODE environment variable is respected.If disabled,
process.fork won’t work as expected. Use Utility Processes instead.boolean
Toggles whether the cookie store on disk is encrypted using OS level cryptography keys.
boolean
Toggles whether the
NODE_OPTIONS and NODE_EXTRA_CA_CERTS environment variables are respected.boolean
Toggles whether the
--inspect, --inspect-brk, etc. flags are respected.boolean
Toggles validation of the
app.asar file content when loaded.Supported on:- macOS (Electron >= 16.0.0)
- Windows (Electron >= 30.0.0)
boolean
Changes the search order to only load from
app.asar. Ensures only validated code is loaded when combined with enableEmbeddedAsarIntegrityValidation.boolean
Changes which V8 snapshot file is used for the browser process (
browser_v8_context_snapshot.bin).boolean
Toggles extra privileges for pages loaded from the
file:// protocol.Toolset Configuration
object
Configuration of toolsets utilized by electron-builder.
string
default:"0.0.0"
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)
string
default:"0.0.0"
appimage bundle version to use for AppImage packaging and runtime.Options:0.0.0(legacy toolset)1.0.2(beta, Runtime 20251108)
Concurrency
object
Experimental configuration for concurrent builds.
number
default:1
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.
string
default:"electron"
The framework name. Options:
electron, proton, libui.string
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.boolean | string
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.