Interface: Configuration
Configuration Options
Extends
Properties
afterAllArtifactBuild?
readonlyoptionalafterAllArtifactBuild?:string|Hook<BuildResult,string[]> |null
The function (or path to file or module id) to be run after all artifacts are built. Receives a BuildResult. May return an array of additional file paths to publish.
For file/module setup, see beforePack.
Example
exports.default = function () {
// return additional files to publish
return ["/path/to/additional/result/file"]
}
Inherited from
afterExtract?
readonlyoptionalafterExtract?:string|Hook<PackContext,void> |null
The function (or path to file or module id) to be run after the prebuilt Electron binary has been extracted to the output directory. Receives an AfterExtractContext. For file/module setup, see beforePack.
Inherited from
afterPack?
readonlyoptionalafterPack?:string|Hook<PackContext,void> |null
The function (or path to file or module id) to be run after pack but before pack into distributable format and sign. Receives an AfterPackContext. For file/module setup, see beforePack.
Inherited from
afterSign?
readonlyoptionalafterSign?:string|Hook<PackContext,void> |null
The function (or path to file or module id) to be run after pack and sign but before pack into distributable format. Receives an AfterPackContext. For file/module setup, see beforePack.
Inherited from
apk?
readonlyoptionalapk?:LinuxTargetSpecificOptions|null
Alpine Linux APK package options. Produces an .apk archive installable via apk add.
Inherited from
appId?
readonlyoptionalappId?:string|null
The application id. Used as CFBundleIdentifier for MacOS and as Application User Model ID for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
Default
com.electron.${name}
Inherited from
appImage?
readonlyoptionalappImage?:AppImageOptions|null
AppImage options. AppImage is a portable application format that bundles the app and its dependencies into a single self-contained executable that runs on most Linux distributions without installation.
Inherited from
appx?
readonlyoptionalappx?:AppXOptions|null
Windows Store (AppX) package options.
Inherited from
appxManifestCreated?
readonlyoptionalappxManifestCreated?:string|Hook<string,void> |null
The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.
Inherited from
artifactBuildCompleted?
readonlyoptionalartifactBuildCompleted?:string|Hook<ArtifactCreated,void> |null
The function (or path to file or module id) to be run when an individual artifact build completes. Receives an ArtifactCreated. For file/module setup, see beforePack.
Inherited from
artifactBuildStarted?
readonlyoptionalartifactBuildStarted?:string|Hook<ArtifactBuildStarted,void> |null
The function (or path to file or module id) to be run when an individual artifact build starts. Receives an ArtifactBuildStarted. For file/module setup, see beforePack.
Inherited from
artifactName?
readonlyoptionalartifactName?:string|null
The artifact file name template. Defaults to ${productName}-${version}.${ext} (some target can have other defaults, see corresponding options).
Inherited from
PlatformSpecificBuildOptions.artifactName
asar?
readonlyoptionalasar?:boolean|AsarOptions|null
Whether to package the application's source code into an archive, using Electron's archive format.
Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set asarUnpack - please file an issue if this doesn't work.
Default
true
Inherited from
PlatformSpecificBuildOptions.asar
asarUnpack?
readonlyoptionalasarUnpack?:string|string[] |null
A glob patterns relative to the app directory, which specifies which files to unpack when creating the asar archive.
Inherited from
PlatformSpecificBuildOptions.asarUnpack
beforeBuild?
readonlyoptionalbeforeBuild?:string|Hook<BeforeBuildContext,boolean|void> |null
The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when npmRebuild is set to true. Resolving to false will skip dependencies install or rebuild.
If provided and node_modules are missing, it will not invoke production dependencies check.
Inherited from
beforePack?
readonlyoptionalbeforePack?:string|Hook<PackContext,void> |null
The function (or path to file or module id) to be run before pack. Receives a BeforePackContext.
Can be specified inline as a function in JavaScript configs:
// electron-builder.config.js
module.exports = {
beforePack: async (context) => {
// your code
}
}
Or as a path to a module that exports the function as its default export:
{ "build": { "beforePack": "./myBeforePackHook.js" } }
// myBeforePackHook.js
exports.default = async function(context) {
// your custom code
}
Inherited from
buildDependenciesFromSource?
optionalbuildDependenciesFromSource?:boolean
Whether to build the application native dependencies from source.
Default
false
Inherited from
CommonConfiguration.buildDependenciesFromSource
buildNumber?
readonlyoptionalbuildNumber?:string|null
The build number. Maps to the --iteration flag for builds using FPM on Linux.
If not defined, then it will fallback to BUILD_NUMBER or TRAVIS_BUILD_NUMBER or APPVEYOR_BUILD_NUMBER or CIRCLE_BUILD_NUM or BUILD_BUILDNUMBER or CI_PIPELINE_IID env.
Inherited from
CommonConfiguration.buildNumber
buildVersion?
readonlyoptionalbuildVersion?:string|null
The build version. Maps to the CFBundleVersion on macOS, and FileVersion metadata property on Windows. Defaults to the version.
If buildVersion is not defined and buildNumber (or one of the buildNumber envs) is defined, it will be used as a build version (version.buildNumber).
Inherited from
CommonConfiguration.buildVersion
compression?
readonlyoptionalcompression?:CompressionLevel|null
The compression level. If you want to rapidly test build, store can reduce build time significantly. maximum doesn't lead to noticeable size difference, but increase build time.
Default
normal
Inherited from
PlatformSpecificBuildOptions.compression
concurrency?
readonlyoptionalconcurrency?:Concurrency|null
[Experimental] Configuration for concurrent builds.
Inherited from
CommonConfiguration.concurrency
copyright?
readonlyoptionalcopyright?:string|null
The human-readable copyright line for the app.
Default
Copyright © year ${author}
Inherited from
deb?
readonlyoptionaldeb?:DebOptions|null
Debian package options. Targets Debian, Ubuntu, and Debian-based distributions.
Produces a .deb archive installable via dpkg -i or apt install.
Inherited from
defaultArch?
readonlyoptionaldefaultArch?:string
The default architecture to build for when no --arch flag is specified.
Defaults to the current machine's architecture.
Inherited from
PlatformSpecificBuildOptions.defaultArch
detectUpdateChannel?
readonlyoptionaldetectUpdateChannel?:boolean
Whether to infer update channel from application version pre-release components. e.g. if version 0.12.1-alpha.1, channel will be set to alpha. Otherwise to latest.
This does not apply to github publishing, which will never auto-detect the update channel.
Default
true
Inherited from
PlatformSpecificBuildOptions.detectUpdateChannel
directories?
readonlyoptionaldirectories?:MetadataDirectories|null
Directories for build resources
Inherited from
CommonConfiguration.directories
disableDefaultIgnoredFiles?
optionaldisableDefaultIgnoredFiles?:boolean|null
Whether to exclude all default ignored files(https://www.electron.build/contents#files) and options. Defaults to false.
Default
false
Inherited from
PlatformSpecificBuildOptions.disableDefaultIgnoredFiles
disableSanityCheckAsar?
readonlyoptionaldisableSanityCheckAsar?:boolean
Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)
Default
false
dmg?
readonlyoptionaldmg?:DmgOptions|null
macOS DMG options.
Inherited from
downloadAlternateFFmpeg?
readonlyoptionaldownloadAlternateFFmpeg?:boolean
Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing
Inherited from
CommonConfiguration.downloadAlternateFFmpeg
electronBranding?
readonlyoptionalelectronBranding?:ElectronBrandingOptions
The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.
electronCompile?
readonlyoptionalelectronCompile?:boolean
Whether to use electron-compile to compile app. Defaults to true if electron-compile in the dependencies. And false if in the devDependencies or doesn't specified.
Deprecated
electron-compile is no longer maintained. Compile your app with a modern bundler (webpack, vite, etc.) instead.
electronDist?
readonlyoptionalelectronDist?:string|Hook<PrepareApplicationStageDirectoryOptions,string> |null
The function (or path to file or module id) to be run when staging the electron artifact environment.
Returns the path to custom Electron build (e.g. ~/electron/out/R) or folder of electron zips.
Zip files must follow the pattern electron-v${version}-${platformName}-${arch}.zip, otherwise it will be assumed to be an unpacked Electron app directory
Inherited from
electronDownload?
readonlyoptionalelectronDownload?:ElectronDownloadOptions|ElectronGetOptions|null
The electron-download options. (legacy) Alternatively, you can use electron/get options.
electronFuses?
readonlyoptionalelectronFuses?:FuseOptionsV1|null
Options to pass to @electron/fuses
Ref: https://github.com/electron/fuses
Inherited from
CommonConfiguration.electronFuses
electronLanguages?
readonlyoptionalelectronLanguages?:string|string[]
The electron locales to keep. By default, all Electron locales used as-is.
Inherited from
PlatformSpecificBuildOptions.electronLanguages
electronUpdaterCompatibility?
readonlyoptionalelectronUpdaterCompatibility?:string|null
The electron-updater compatibility semver range.
Inherited from
PlatformSpecificBuildOptions.electronUpdaterCompatibility
electronVersion?
optionalelectronVersion?:string|null
The version of electron you are packaging for. Defaults to version of electron, electron-prebuilt or electron-prebuilt-compile dependency.
executableName?
readonlyoptionalexecutableName?:string|null
The executable name. Defaults to productName
Note: Except for Linux, where this would constitute a breaking change in previous behavior and lead to both invalid executable names and Desktop files. Ref comments in: https://github.com/electron-userland/electron-builder/pull/9068
Inherited from
PlatformSpecificBuildOptions.executableName
extends?
optionalextends?:string|string[] |null
The name of a built-in configuration preset (currently, only react-cra is supported) or any number of paths to config files (relative to project dir).
The latter allows to mixin a config from multiple other configs, as if you Object.assign them, but properly combine files glob patterns.
If react-scripts in the app dependencies, react-cra will be set automatically. Set to null to disable automatic detection.
extraFiles?
optionalextraFiles?:string|FileSet| (string|FileSet)[] |null
The same as extraResources but copy into the app's content directory (Contents for MacOS, root directory for Linux and Windows).
Inherited from
PlatformSpecificBuildOptions.extraFiles
extraMetadata?
readonlyoptionalextraMetadata?:any
Inject properties to package.json.
Inherited from
CommonConfiguration.extraMetadata
extraResources?
optionalextraResources?:string|FileSet| (string|FileSet)[] |null
A glob patterns relative to the project directory, when specified, copy the file or directory with matching names directly into the app's resources directory (Contents/Resources for MacOS, resources for Linux and Windows).
File patterns (and support for from and to fields) the same as for files.
Inherited from
PlatformSpecificBuildOptions.extraResources
fileAssociations?
readonlyoptionalfileAssociations?:FileAssociation|FileAssociation[]
The file associations.
Inherited from
PlatformSpecificBuildOptions.fileAssociations
files?
optionalfiles?:string|FileSet| (string|FileSet)[] |null
A glob patterns relative to the app directory, which specifies which files to include when copying files to create the package.
Defaults to:
[
"**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!.editorconfig",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}"
]
Development dependencies are never copied in any case. You don't need to ignore it explicitly. Hidden files are not ignored by default, but all files that should be ignored, are ignored by default.
Default pattern **/* is not added to your custom if some of your patterns is not ignore (i.e. not starts with !). package.json and **/node_modules/**/* (only production dependencies will be copied) is added to your custom in any case. All default ignores are added in any case — you don't need to repeat it if you configure own patterns.
May be specified in the platform options (e.g. in the mac).
You may also specify custom source and destination directories by using FileSet objects instead of simple glob patterns.
[
{
"from": "path/to/source",
"to": "path/to/destination",
"filter": ["**/*", "!foo/*.js"]
}
]
You can use file macros in the from and to fields as well. from and to can be files and you can use this to rename a file while packaging.
Inherited from
PlatformSpecificBuildOptions.files
flatpak?
readonlyoptionalflatpak?:FlatpakOptions|null
Flatpak options. Flatpak is a sandboxed application distribution format for Linux that runs in a controlled environment and is distributed via Flathub or other Flatpak repositories.
Inherited from
forceCodeSigning?
readonlyoptionalforceCodeSigning?:boolean
Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).
Default
false
Inherited from
CommonConfiguration.forceCodeSigning
framework?
readonlyoptionalframework?:string|null
The framework name. One of electron, proton, libui. Defaults to electron.
Deprecated
proton and libui framework support is no longer actively maintained. Use electron (the default).
freebsd?
readonlyoptionalfreebsd?:LinuxTargetSpecificOptions|null
FreeBSD package options. Produces a .pkg archive for the FreeBSD pkg package manager.
Inherited from
generateUpdatesFilesForAllChannels?
readonlyoptionalgenerateUpdatesFilesForAllChannels?:boolean
Please see Building and Releasing using Channels.
Default
false
Inherited from
PlatformSpecificBuildOptions.generateUpdatesFilesForAllChannels
includePdb?
readonlyoptionalincludePdb?:boolean
Whether to include PDB files.
Default
false
Inherited from
CommonConfiguration.includePdb
launchUiVersion?
readonlyoptionallaunchUiVersion?:string|boolean|null
libui-based frameworks only The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.
Deprecated
libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.
linux?
readonlyoptionallinux?:LinuxConfiguration|null
General Linux build options shared across all Linux targets (icon, category, desktop entry,
executable name, etc.). Target-specific compression and packaging options live in the
per-format interfaces (DebOptions, RpmOptions, PacmanOptions, etc.).
Inherited from
mac?
readonlyoptionalmac?:MacConfiguration|null
Options related to how build macOS targets.
Inherited from
mas?
readonlyoptionalmas?:MasConfiguration|null
MAS (Mac Application Store) options.
Inherited from
masDev?
readonlyoptionalmasDev?:MasConfiguration|null
MAS (Mac Application Store) development options (mas-dev target).
Inherited from
msi?
readonlyoptionalmsi?:MsiOptions|null
MSI package options.
Inherited from
msiProjectCreated?
readonlyoptionalmsiProjectCreated?:string|Hook<string,void> |null
The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.
Inherited from
msiWrapped?
readonlyoptionalmsiWrapped?:MsiWrappedOptions|null
MSI-wrapped installer options.
Inherited from
CommonConfiguration.msiWrapped
nativeRebuilder?
readonlyoptionalnativeRebuilder?:"legacy"|"sequential"|"parallel"|null
Use legacy app-builder binary for installing native dependencies, or @electron/rebuild in sequential or parallel compilation modes.
Default
sequential
Inherited from
CommonConfiguration.nativeRebuilder
nodeGypRebuild?
readonlyoptionalnodeGypRebuild?:boolean
Whether to execute node-gyp rebuild before starting to package the app.
Don't use npm (neither .npmrc) for configuring electron headers. Use electron-builder node-gyp-rebuild instead.
Default
false
Inherited from
CommonConfiguration.nodeGypRebuild
nodeVersion?
readonlyoptionalnodeVersion?:string|null
libui-based frameworks only The version of NodeJS you are packaging for.
You can set it to current to set the Node.js version that you use to run.
Deprecated
libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.
npmArgs?
readonlyoptionalnpmArgs?:string|string[] |null
Additional command line arguments to use when installing app native deps.
Inherited from
npmRebuild?
readonlyoptionalnpmRebuild?:boolean
Whether to rebuild native dependencies before starting to package the app.
Default
true
Inherited from
CommonConfiguration.npmRebuild
nsis?
readonlyoptionalnsis?:NsisOptions|null
NSIS installer options.
Inherited from
nsisWeb?
readonlyoptionalnsisWeb?:NsisWebOptions|null
NSIS web installer options (downloads app package at install time).
Inherited from
onNodeModuleFile?
readonlyoptionalonNodeModuleFile?:string|Hook<string,boolean|void> |null
The function (or path to file or module id) to be run on each node module file. Returning true/false will determine whether to force include or to use the default copier logic
Inherited from
p5p?
readonlyoptionalp5p?:LinuxTargetSpecificOptions|null
Solaris IPS package options. Produces a .p5p archive for the Solaris Image Packaging
System (pkg).
Inherited from
pacman?
readonlyoptionalpacman?:PacmanOptions|null
Pacman package options. Targets Arch Linux and Arch-based distributions
(Manjaro, EndeavourOS, etc.). Produces a .pacman archive installable via pacman -U.
Inherited from
pkg?
readonlyoptionalpkg?:PkgOptions|null
macOS PKG options.
Inherited from
portable?
readonlyoptionalportable?:PortableOptions|null
Portable executable options (no installation required).
Inherited from
productName?
readonlyoptionalproductName?:string|null
As name, but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the name property.
If not specified inside of the build configuration, productName property defined at the top level of package.json is used. If not specified at the top level of package.json, name property is used.
Inherited from
CommonConfiguration.productName
protocols?
The URL protocol schemes.
Inherited from
PlatformSpecificBuildOptions.protocols
publish?
optionalpublish?:Publish
Publisher configuration. See Auto Update for more information.
Inherited from
PlatformSpecificBuildOptions.publish
releaseInfo?
readonlyoptionalreleaseInfo?:ReleaseInfo
The release info. Intended for command line usage:
-c.releaseInfo.releaseNotes="new features"
Inherited from
PlatformSpecificBuildOptions.releaseInfo
removePackageKeywords?
readonlyoptionalremovePackageKeywords?:boolean
Whether to remove keywords field from package.json files.
Default
true
Inherited from
CommonConfiguration.removePackageKeywords
removePackageScripts?
readonlyoptionalremovePackageScripts?:boolean
Whether to remove scripts field from package.json files.
Default
true
Inherited from
CommonConfiguration.removePackageScripts
rpm?
readonlyoptionalrpm?:RpmOptions|null
RPM package options. Targets Fedora, Red Hat Enterprise Linux, SUSE, and related
distributions. Produces a .rpm archive installable via rpm or dnf.
Inherited from
snap?
readonlyoptionalsnap?:SnapOptions|null
Snap package options. Requires snapcraft to be installed.
Inherited from
squirrelWindows?
readonlyoptionalsquirrelWindows?:SquirrelWindowsOptions|null
Squirrel.Windows installer options. Requires the electron-builder-squirrel-windows dependency.
Inherited from
CommonConfiguration.squirrelWindows
target?
readonlyoptionaltarget?:string|TargetConfiguration| (string|TargetConfiguration)[] |null
The build target(s) for this platform. Can be a target name string, a TargetConfiguration object, or an array of either. Available targets depend on the platform — see platform-specific options (e.g. MacConfiguration.target, WindowsConfiguration.target, LinuxConfiguration.target).
Inherited from
PlatformSpecificBuildOptions.target
toolsets?
readonlyoptionaltoolsets?:ToolsetConfig|null
Configuration of toolsets utilized by electron-builder
Inherited from
win?
readonlyoptionalwin?:WindowsConfiguration|null
Options related to how build Windows targets.