Skip to main content

Interface: Configuration

Configuration Options

Extends​

Properties​

afterAllArtifactBuild?​

readonly optional afterAllArtifactBuild?: 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​

Hooks.afterAllArtifactBuild


afterExtract?​

readonly optional afterExtract?: 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​

Hooks.afterExtract


afterPack?​

readonly optional afterPack?: 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​

Hooks.afterPack


afterSign?​

readonly optional afterSign?: 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​

Hooks.afterSign


allowMissingDependencies?​

readonly optional allowMissingDependencies?: boolean | string[] | null

Whether production dependencies that cannot be resolved during node-module collection are allowed — i.e. whether the build should continue with a warning instead of failing.

During collection every production dependency must resolve to an installed package on disk. A dependency that does not resolve (cannot find path for dependency / dependency not found on disk) is not bundled, which typically breaks the packaged app at runtime with MODULE_NOT_FOUND.

  • true (or omitted — the v26 default): missing production dependencies are only logged as warnings, keeping the historical behavior of the stable 26.x line. (electron-builder 27+ defaults to false and fails the build instead.)
  • false or null: the build fails after dependency collection completes, reporting the complete list of missing production dependencies at once.
  • string[]: the listed dependency names are allowed to be missing; any other missing production dependency fails the build. Entries match the package name of the reported name@version entry (e.g. some-native-module, @scope/pkg), or an exact name@version string to allow only that resolved version to be missing.

Missing optional dependencies (declared in optionalDependencies, e.g. fsevents on Linux/Windows, or platform-specific packages) are always allowed and never fail the build.

Default​

true

Inherited from​

CommonConfiguration.allowMissingDependencies


apk?​

readonly optional apk?: LinuxTargetSpecificOptions | null

Alpine Linux APK package options. Produces an .apk archive installable via apk add.

Inherited from​

CommonConfiguration.apk


appId?​

readonly optional appId?: 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​

CommonConfiguration.appId


appImage?​

readonly optional appImage?: 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​

CommonConfiguration.appImage


appx?​

readonly optional appx?: AppXOptions | null

Windows Store (AppX) package options.

Inherited from​

CommonConfiguration.appx


appxManifestCreated?​

readonly optional appxManifestCreated?: 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​

Hooks.appxManifestCreated


artifactBuildCompleted?​

readonly optional artifactBuildCompleted?: 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​

Hooks.artifactBuildCompleted


artifactBuildStarted?​

readonly optional artifactBuildStarted?: 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​

Hooks.artifactBuildStarted


artifactName?​

readonly optional artifactName?: 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?​

readonly optional asar?: 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?​

readonly optional asarUnpack?: 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?​

readonly optional beforeBuild?: 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​

Hooks.beforeBuild


beforePack?​

readonly optional beforePack?: 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​

Hooks.beforePack


buildDependenciesFromSource?​

optional buildDependenciesFromSource?: boolean

Whether to build the application native dependencies from source.

Default​

false

Inherited from​

CommonConfiguration.buildDependenciesFromSource


buildNumber?​

readonly optional buildNumber?: 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?​

readonly optional buildVersion?: 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?​

readonly optional compression?: 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?​

readonly optional concurrency?: Concurrency | null

[Experimental] Configuration for concurrent builds.

Inherited from​

CommonConfiguration.concurrency


readonly optional copyright?: string | null

The human-readable copyright line for the app.

Default​

Copyright © year ${author}

Inherited from​

CommonConfiguration.copyright


deb?​

readonly optional deb?: 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​

CommonConfiguration.deb


defaultArch?​

readonly optional defaultArch?: 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?​

readonly optional detectUpdateChannel?: 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?​

readonly optional directories?: MetadataDirectories | null

Directories for build resources

Inherited from​

CommonConfiguration.directories


disableAsarIntegrity?​

readonly optional disableAsarIntegrity?: boolean

Whether to skip ASAR integrity hash computation. Useful for custom electron forks with encrypted ASAR support where the header is not readable by standard tools.

Default​

false

disableDefaultIgnoredFiles?​

optional disableDefaultIgnoredFiles?: 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?​

readonly optional disableSanityCheckAsar?: boolean

Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)

Default​

false

dmg?​

readonly optional dmg?: DmgOptions | null

macOS DMG options.

Inherited from​

CommonConfiguration.dmg


downloadAlternateFFmpeg?​

readonly optional downloadAlternateFFmpeg?: 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?​

readonly optional electronBranding?: ElectronBrandingOptions

The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.


electronCompile?​

readonly optional electronCompile?: 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?​

readonly optional electronDist?: 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​

Hooks.electronDist


electronDownload?​

readonly optional electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null

The electron-download options. (legacy) Alternatively, you can use electron/get options.

checksums (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline — without it, @electron/get fetches SHASUMS256.txt from the network on every build, even when the artifact itself is already cached. When checksums is not configured, electron-builder automatically picks up a locally seeded SHASUMS256.txt-<version> (or SHASUMS256.txt) file at the root of the Electron cache directory. See the air-gapped / offline builds guide.


electronFuses?​

readonly optional electronFuses?: FuseOptionsV1 | null

Options to pass to @electron/fuses Ref: https://github.com/electron/fuses

Inherited from​

CommonConfiguration.electronFuses


electronLanguages?​

readonly optional electronLanguages?: string | string[]

The electron locales to keep. By default, all Electron locales used as-is.

Inherited from​

PlatformSpecificBuildOptions.electronLanguages


electronUpdaterCompatibility?​

readonly optional electronUpdaterCompatibility?: string | null

The electron-updater compatibility semver range.

Inherited from​

PlatformSpecificBuildOptions.electronUpdaterCompatibility


electronVersion?​

optional electronVersion?: string | null

The version of electron you are packaging for. Defaults to version of electron, electron-prebuilt or electron-prebuilt-compile dependency.


executableName?​

readonly optional executableName?: 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?​

optional extends?: 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?​

optional extraFiles?: 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?​

readonly optional extraMetadata?: any

Inject properties to package.json.

Inherited from​

CommonConfiguration.extraMetadata


extraResources?​

optional extraResources?: 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?​

readonly optional fileAssociations?: FileAssociation | FileAssociation[]

The file associations.

Inherited from​

PlatformSpecificBuildOptions.fileAssociations


files?​

optional files?: 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?​

readonly optional flatpak?: 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​

CommonConfiguration.flatpak


forceCodeSigning?​

readonly optional forceCodeSigning?: 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?​

readonly optional framework?: 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?​

readonly optional freebsd?: LinuxTargetSpecificOptions | null

FreeBSD package options. Produces a .pkg archive for the FreeBSD pkg package manager.

Inherited from​

CommonConfiguration.freebsd


generateUpdatesFilesForAllChannels?​

readonly optional generateUpdatesFilesForAllChannels?: boolean

Please see Building and Releasing using Channels.

Default​

false

Inherited from​

PlatformSpecificBuildOptions.generateUpdatesFilesForAllChannels


includePdb?​

readonly optional includePdb?: boolean

Whether to include PDB files.

Default​

false

Inherited from​

CommonConfiguration.includePdb


launchUiVersion?​

readonly optional launchUiVersion?: 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?​

readonly optional linux?: 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​

CommonConfiguration.linux


mac?​

readonly optional mac?: MacConfiguration | null

Options related to how build macOS targets.

Inherited from​

CommonConfiguration.mac


mas?​

readonly optional mas?: MasConfiguration | null

MAS (Mac Application Store) options.

Inherited from​

CommonConfiguration.mas


masDev?​

readonly optional masDev?: MasConfiguration | null

MAS (Mac Application Store) development options (mas-dev target).

Inherited from​

CommonConfiguration.masDev


msi?​

readonly optional msi?: MsiOptions | null

MSI package options.

Inherited from​

CommonConfiguration.msi


msiProjectCreated?​

readonly optional msiProjectCreated?: 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​

Hooks.msiProjectCreated


msiWrapped?​

readonly optional msiWrapped?: MsiWrappedOptions | null

MSI-wrapped installer options.

Inherited from​

CommonConfiguration.msiWrapped


nativeRebuilder?​

readonly optional nativeRebuilder?: "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?​

readonly optional nodeGypRebuild?: 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?​

readonly optional nodeVersion?: 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?​

readonly optional npmArgs?: string | string[] | null

Additional command line arguments to use when installing app native deps.

Inherited from​

CommonConfiguration.npmArgs


npmRebuild?​

readonly optional npmRebuild?: boolean

Whether to rebuild native dependencies before starting to package the app.

Default​

true

Inherited from​

CommonConfiguration.npmRebuild


nsis?​

readonly optional nsis?: NsisOptions | null

NSIS installer options.

Inherited from​

CommonConfiguration.nsis


nsisWeb?​

readonly optional nsisWeb?: NsisWebOptions | null

NSIS web installer options (downloads app package at install time).

Inherited from​

CommonConfiguration.nsisWeb


onNodeModuleFile?​

readonly optional onNodeModuleFile?: 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​

Hooks.onNodeModuleFile


p5p?​

readonly optional p5p?: LinuxTargetSpecificOptions | null

Solaris IPS package options. Produces a .p5p archive for the Solaris Image Packaging System (pkg).

Inherited from​

CommonConfiguration.p5p


pacman?​

readonly optional pacman?: 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​

CommonConfiguration.pacman


pkg?​

readonly optional pkg?: PkgOptions | null

macOS PKG options.

Inherited from​

CommonConfiguration.pkg


portable?​

readonly optional portable?: PortableOptions | null

Portable executable options (no installation required).

Inherited from​

CommonConfiguration.portable


productName?​

readonly optional productName?: 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?​

readonly optional protocols?: Protocol | Protocol[]

The URL protocol schemes.

Inherited from​

PlatformSpecificBuildOptions.protocols


publish?​

optional publish?: Publish

Publisher configuration. See Auto Update for more information.

Inherited from​

PlatformSpecificBuildOptions.publish


releaseInfo?​

readonly optional releaseInfo?: ReleaseInfo

The release info. Intended for command line usage:

-c.releaseInfo.releaseNotes="new features"

Inherited from​

PlatformSpecificBuildOptions.releaseInfo


removePackageKeywords?​

readonly optional removePackageKeywords?: boolean

Whether to remove keywords field from package.json files.

Default​

true

Inherited from​

CommonConfiguration.removePackageKeywords


removePackageScripts?​

readonly optional removePackageScripts?: boolean

Whether to remove scripts field from package.json files.

Default​

true

Inherited from​

CommonConfiguration.removePackageScripts


rpm?​

readonly optional rpm?: 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​

CommonConfiguration.rpm


snap?​

readonly optional snap?: SnapOptions | null

Flat snap configuration targeting core22 and older snap bases.

Deprecated​

Use snapcraft instead — it supersedes snap when both are present and supports all snap bases including core24. snap will be removed in a future major release. See SnapOptions for available properties.

Inherited from​

CommonConfiguration.snap


snapcraft?​

readonly optional snapcraft?: SnapcraftOptions | null

Snapcraft configuration. Prefer this over the deprecated snap field.

Selects the snapcraft base and provides per-core options:

  • base: "core18" | "core20" | "core22" — legacy builds; accepts the same options as snap
  • base: "core24" — modern builds with the GNOME extension (recommended for new apps, requires Electron 25+)
  • base: "custom" — pass an existing snapcraft.yaml through unchanged; no plugs, extensions, or desktop files are injected

When both snapcraft and snap are set, snapcraft takes precedence.

Example​

{ "snapcraft": { "base": "core24", "core24": { "useLXD": true } } }

See SnapcraftOptions for all available properties.

Inherited from​

CommonConfiguration.snapcraft


squirrelWindows?​

readonly optional squirrelWindows?: SquirrelWindowsOptions | null

Squirrel.Windows installer options. Requires the electron-builder-squirrel-windows dependency.

Inherited from​

CommonConfiguration.squirrelWindows


target?​

readonly optional target?: 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?​

readonly optional toolsets?: ToolsetConfig | null

Configuration of toolsets utilized by electron-builder

Inherited from​

CommonConfiguration.toolsets


win?​

readonly optional win?: WindowsConfiguration | null

Options related to how build Windows targets.

Inherited from​

CommonConfiguration.win