Skip to main content

Interface: MasConfiguration

Extends​

Properties​

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​

MacConfiguration.appId


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​

MacConfiguration.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. Use AsarOptions.unpack to specify additional files to unpack.

Default​

true

Inherited from​

MacConfiguration.asar


asarIntegrityDigest?​

readonly optional asarIntegrityDigest?: boolean

Whether to embed the ASAR integrity digest into the Electron Framework binary.

The digest covers the ElectronAsarIntegrity entries of Info.plist, so with the enableEmbeddedAsarIntegrityValidation fuse (see electronFuses) the app refuses to launch if those entries are changed, for example to match a modified app.asar. Embedding the digest modifies the Electron Framework, which is then signed again ad hoc; code signing the app replaces that signature.

Applies only when:

  • Electron is 41 or later
  • the build runs on macOS (codesign signs the modified framework again)
  • asar is enabled and asar.disableIntegrity is not true

Set to false if you change app.asar or Info.plist after the afterPack hook, sign the app yourself in afterPack, or merge separately built x64 and arm64 apps with @electron/universal yourself (build the universal arch instead).

Default​

true

Inherited from​

MacConfiguration.asarIntegrityDigest


bundleShortVersion?​

readonly optional bundleShortVersion?: string | null

The CFBundleShortVersionString. Do not use it unless you need to.

Inherited from​

MacConfiguration.bundleShortVersion


bundleVersion?​

readonly optional bundleVersion?: string | null

The CFBundleVersion. Do not use it unless you need to.

Inherited from​

MacConfiguration.bundleVersion


category?​

readonly optional category?: string | null

The application category type, as shown in the Finder via View -> Arrange by Application Category when viewing the Applications directory.

For example, "category": "public.app-category.developer-tools" will set the application category to Developer Tools.

Valid values are listed in Apple's documentation.

Inherited from​

MacConfiguration.category


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​

MacConfiguration.compression


darkModeSupport?​

readonly optional darkModeSupport?: boolean

Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.

Default​

false

Inherited from​

MacConfiguration.darkModeSupport


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​

MacConfiguration.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​

MacConfiguration.detectUpdateChannel


electronLanguages?​

readonly optional electronLanguages?: string | string[]

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

Inherited from​

MacConfiguration.electronLanguages


electronUpdaterCompatibility?​

readonly optional electronUpdaterCompatibility?: string | null

The electron-updater compatibility semver range: the electron-updater versions the installed apps ship, which have to read the update files this build writes. It selects the .blockmap format (see blockmap), and the build fails when the app's electron-updater does not satisfy it.

Default​

>=7

Inherited from​

MacConfiguration.electronUpdaterCompatibility


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​

MacConfiguration.executableName


extendInfo?​

readonly optional extendInfo?: any

The extra entries for Info.plist.

Inherited from​

MacConfiguration.extendInfo


extraDistFiles?​

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

Extra files to put in archive. Not applicable for tar.*.

Inherited from​

MacConfiguration.extraDistFiles


fileAssociations?​

readonly optional fileAssociations?: FileAssociation | FileAssociation[]

The file associations.

Inherited from​

MacConfiguration.fileAssociations


fileOptions?​

optional fileOptions?: FilesBuildOptions | null

Which files to copy into the packaged app (files, the app sources, extraResources and extraFiles), which file extensions to exclude from it (excludedExts), and whether symlinks among them may lead outside the app and the workspace (allowExternalLinks). Set at the configuration root, per platform (e.g. mac.fileOptions), or both: a platform's file lists are added to the root ones, and a platform's excludedExts and allowExternalLinks replace the root ones.

{
"fileOptions": {
"files": ["dist/**/*", "package.json"],
"extraResources": [{ "from": "assets/bin", "to": "bin" }]
}
}

files, extraResources and extraFiles set directly on the configuration or a platform section are moved here when the configuration is loaded, with a warning. Run electron-builder migrate-schema to update the configuration.

Inherited from​

MacConfiguration.fileOptions


forceCodeSigning?​

readonly optional forceCodeSigning?: boolean

Overrides the root forceCodeSigning for this platform: whether to fail the build if the app could not be code-signed, notarized, or have its auto-update manifests signed, and to verify the signatures it produces. See the root option for what is enforced. Mac App Store builds cascade mac → mas (→ masDev for mas-dev), like every other option, so mas.forceCodeSigning / masDev.forceCodeSigning apply to their targets only.

Default​

false

Inherited from​

MacConfiguration.forceCodeSigning


generateUpdatesFilesForAllChannels?​

readonly optional generateUpdatesFilesForAllChannels?: boolean

Please see Building and Releasing using Channels.

Default​

false

Inherited from​

MacConfiguration.generateUpdatesFilesForAllChannels


helperBundleId?​

readonly optional helperBundleId?: string | null

The bundle identifier to use in the application helper's plist.

Default​

${appBundleIdentifier}.helper

Inherited from​

MacConfiguration.helperBundleId


helperEHBundleId?​

readonly optional helperEHBundleId?: string | null

The bundle identifier to use in the EH helper's plist.

Default​

${appBundleIdentifier}.helper.EH

Inherited from​

MacConfiguration.helperEHBundleId


helperGPUBundleId?​

readonly optional helperGPUBundleId?: string | null

The bundle identifier to use in the GPU helper's plist.

Default​

${appBundleIdentifier}.helper.GPU

Inherited from​

MacConfiguration.helperGPUBundleId


helperNPBundleId?​

readonly optional helperNPBundleId?: string | null

The bundle identifier to use in the NP helper's plist.

Default​

${appBundleIdentifier}.helper.NP

Inherited from​

MacConfiguration.helperNPBundleId


helperPluginBundleId?​

readonly optional helperPluginBundleId?: string | null

The bundle identifier to use in the Plugin helper's plist.

Default​

${appBundleIdentifier}.helper.Plugin

Inherited from​

MacConfiguration.helperPluginBundleId


helperRendererBundleId?​

readonly optional helperRendererBundleId?: string | null

The bundle identifier to use in the Renderer helper's plist.

Default​

${appBundleIdentifier}.helper.Renderer

Inherited from​

MacConfiguration.helperRendererBundleId


icon?​

readonly optional icon?: string | null

The path to application icon. Accepts .icns (legacy) or .icon (Icon Composer asset). If a .icon asset is provided, it will be preferred and compiled to an asset catalog.

Default​

build/icon.icns

Inherited from​

MacConfiguration.icon


minimumSystemVersion?​

readonly optional minimumSystemVersion?: string | null

The minimum version of macOS required for the app to run. Corresponds to LSMinimumSystemVersion.

Inherited from​

MacConfiguration.minimumSystemVersion


notarize?​

readonly optional notarize?: boolean

Whether to notarize the app with @electron/notarize.

  • unset (the default): notarize when notarization credentials are set, otherwise skip it with a warning.
  • true: notarization is required: the build fails when no credentials are set, wherever notarization would run (a macOS host, outside a pull-request build, with signing not turned off), at build start and when notarizing.
  • false: never notarize (for an ad-hoc or development-signed app, or one notarized in an afterSign hook).

The credentials are one of the following sets of environment variables:

  1. APPLE_API_KEY (path to the .p8 file, or its contents base64-encoded), APPLE_API_KEY_ID and APPLE_API_ISSUER.
  2. APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, and APPLE_TEAM_ID
  3. APPLE_KEYCHAIN and APPLE_KEYCHAIN_PROFILE

For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)

Inherited from​

MacConfiguration.notarize


protocols?​

readonly optional protocols?: Protocol | Protocol[]

The URL protocol schemes.

Inherited from​

MacConfiguration.protocols


publish?​

optional publish?: Publish

Publisher configuration. See Auto Update for more information.

Inherited from​

MacConfiguration.publish


releaseInfo?​

readonly optional releaseInfo?: ReleaseInfo

The release info. Intended for command line usage:

-c.releaseInfo.releaseNotes="new features"

Inherited from​

MacConfiguration.releaseInfo


sign?​

readonly optional sign?: string | ElectronSignOptions | CustomMacSign | null

Codesigning configuration. The signing certificate is selected via sign.identity (or the CSC_LINK / CSC_NAME environment variables).

  • Not set (default): electron-builder auto-discovers a valid certificate in the keychain. If none is found, signing is skipped.
  • null: skip signing entirely.
  • string: path or module ID of a file that exports a CustomMacSign function.
  • CustomMacSign: inline custom signing function (JS/TS config only).
  • ElectronSignOptions: options forwarded directly to @electron/osx-sign.

See​

Inherited from​

MacConfiguration.sign


target?​

readonly optional target?: TargetConfiguration | MacOsTargetName | TargetConfiguration | MacOsTargetName[] | null

The target package type: list of default, dmg, mas, mas-dev, pkg, 7z, zip, tar.xz, tar.lz, tar.gz, tar.bz2, dir. Note: Squirrel.Mac auto update mechanism requires both dmg and zip to be enabled, even when only dmg is used. Disabling zip will break auto update in dmg packages.

Default​

default (dmg and zip for Squirrel.Mac)

Inherited from​

MacConfiguration.target


universal?​

readonly optional universal?: ElectronUniversalOptions | null

Options forwarded to @electron/universal when building a universal (multi-arch) app. Has no effect unless the target arch is universal.

See​

Inherited from​

MacConfiguration.universal


updateManifest?​

readonly optional updateManifest?: false | UpdateManifestSigningOptions | null

Ed25519 signing of the auto-update manifest (latest*.yml). Each manifest is signed and its public key is embedded into app-update.yml, so electron-updater verifies the signature before downloading an update.

Signing is required. Publishing a build that emits auto-update metadata fails unless a signing key resolves. Generate one once with electron-builder create-update-key, then supply it via ELECTRON_BUILDER_UPDATE_SIGN_KEY (the PEM file, base64-encoded) / ELECTRON_BUILDER_UPDATE_SIGN_KEY_FILE (its path), preferred in CI, or via signingKey / signingKeyFile below. Leaving this option unset — or null — keeps signing required and resolves the key from the environment; null is not an opt-out.

Set to false, the only opt-out, to ship unsigned manifests. Every build that produces a manifest then logs a warning. false also short-circuits the environment variables, so a leftover ELECTRON_BUILDER_UPDATE_SIGN_KEY in CI cannot re-enable signing by accident.

The requirement is enforced when a publish policy is in effect (--publish) or forceCodeSigning is set; any other build warns instead, so local builds and pipelines that sign the manifest in a later step of their own are unaffected. It is also waived when every publish provider has publishAutoUpdate: false, since no manifest is emitted then, and for a build whose targets write no update info (e.g. only snap, flatpak, MSI/MSIX, portable, mas/pkg or plain archives). A publishing (or forceCodeSigning) build checks for the key at build start, before anything is packed or uploaded. Every signed manifest is read back and verified before it is written.

See Signed Update Manifests.

Inherited from​

MacConfiguration.updateManifest