Configuration Methods
Using package.json
The simplest method is to add abuild key to your package.json file:
package.json
Using Separate Configuration Files
For larger projects, you can use a separate configuration file. Use the--config option to specify the path:
By default, electron-builder looks for
electron-builder.yml in your project root.- YAML
- JSON5
- TOML
electron-builder.yml
Using JavaScript/TypeScript
For dynamic configuration, you can use JavaScript or TypeScript files:electron-builder.config.js
electron-builder.config.js
Core Configuration Options
Application Identity
Directories
Build Version Management
On CI servers (Travis, AppVeyor, CircleCI, Bamboo),
buildNumber automatically falls back to BUILD_NUMBER, TRAVIS_BUILD_NUMBER, APPVEYOR_BUILD_NUMBER, CIRCLE_BUILD_NUM, BUILD_BUILDNUMBER, or CI_PIPELINE_IID environment variables.Native Dependencies
Platform-Specific Configuration
Configuration can be overridden per platform usingmac, win, and linux keys:
electron-builder.yml
Environment Variables
You can create anelectron-builder.env file in your project root for environment variables:
electron-builder.env
Environment variable files are only supported for CLI usage.
Configuration Extends
You can extend from built-in presets or other configuration files:package.json
If
react-scripts is in your app dependencies, react-cra preset is set automatically. Set to null to disable.Null Values
Most options acceptnull to explicitly disable default behavior:
Reading Documentation Conventions
- Bold property names are required
- Normal property names are optional
- Types are specified after property names:
Array<String> | String - Union types mean you can specify either format:
"**/*"or["**/*", "!foo.js"]