Skip to main content
electron-builder configuration can be defined in multiple ways, giving you flexibility in how you structure your build setup.

Configuration Methods

Using package.json

The simplest method is to add a build 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.
electron-builder.yml

Using JavaScript/TypeScript

For dynamic configuration, you can use JavaScript or TypeScript files:
electron-builder.config.js
Or export a function that returns configuration:
electron-builder.config.js
Do not name your JavaScript config file electron-builder.js as it will conflict with the electron-builder package name.

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 using mac, win, and linux keys:
electron-builder.yml

Environment Variables

You can create an electron-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
Or extend from multiple files:
If react-scripts is in your app dependencies, react-cra preset is set automatically. Set to null to disable.

Null Values

Most options accept null 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"]