Common Configuration
electron-builder configuration can be defined
- in the
package.json
file of your project using thebuild
key on the top level:"build": { "appId": "com.example.app" }
-
or through the
--config <path/to/yml-or-json5-or-toml-or-js>
option. Defaults toelectron-builder.yml
.appId: "com.example.app"
json
, json5, toml orjs
/ts
(exported configuration or function that produces configuration) formats also supported.Tip
If you want to use
js
file, do not name itelectron-builder.js
. It will conflict withelectron-builder
package name.Tip
If you want to use toml, please install
yarn add toml --dev
.
Most of the options accept null
— for example, to explicitly set that DMG icon must be default volume icon from the OS and default rules must be not applied (i.e. use application icon as DMG icon), set dmg.icon
to null
.
Artifact File Name Template¶
${ext}
macro is supported in addition to file macros.
Environment Variables from File¶
Env file electron-builder.env
in the current dir (example). Supported only for CLI usage.
How to Read Docs¶
- Name of optional property is normal, required is bold.
- Type is specified after property name:
Array<String> | String
. Union like this means that you can specify or string (**/*
), or array of strings (["**/*", "!foo.js"]
).
Common Configuration¶
Overridable per Platform Options¶
Following options can be set also per platform (top-level keys mac, linux and win) if need.
Base Configuration¶
Metadata¶
Some standard fields should be defined in the package.json
.
Proton Native¶
To package Proton Native app, set protonNodeVersion
option to current
or specific NodeJS version that you are packaging for.
Currently, only macOS and Linux supported.
Build Version Management¶
CFBundleVersion
(macOS) and FileVersion
(Windows) will be set automatically to version.build_number
on CI server (Travis, AppVeyor, CircleCI and Bamboo supported).
Build Hooks¶
#### Hooks
Node.js 8
All examples assumed that you use latest Node.js 8.11.x or higher.