Skip to main content
Platform-specific options configure how electron-builder builds and packages applications for macOS, Windows, and Linux.

PlatformSpecificBuildOptions

Base interface for all platform-specific options. Source: packages/app-builder-lib/src/options/PlatformSpecificBuildOptions.ts:95

Common Properties

appId
string | null
default:"com.electron.${name}"
The application ID. Used as CFBundleIdentifier for macOS and Application User Model ID for Windows (NSIS only).
artifactName
string | null
The artifact file name template. Defaults to ${productName}-${version}.${ext}.Available variables:
  • ${name} - Package name
  • ${productName} - Product name
  • ${version} - Version
  • ${ext} - File extension
  • ${os} - OS name
  • ${arch} - Architecture
  • ${channel} - Update channel
Example: "${productName}-${version}-${arch}.${ext}"
executableName
string | null
The executable name. Defaults to productName. Note: On Linux, this would constitute a breaking change.
compression
CompressionLevel | null
default:"normal"
The compression level:
  • store - No compression (fastest, largest)
  • normal - Standard compression (default)
  • maximum - Maximum compression (slowest, smallest)

File Patterns

files
Array<FileSet | string> | FileSet | string | null
Glob patterns for files to include in the app package.Example:
{
  "files": [
    "dist/**/*",
    "!dist/**/*.map",
    "package.json"
  ]
}
extraResources
Array<FileSet | string> | FileSet | string | null
Files to copy into the app’s resources directory.macOS: Contents/Resources Windows/Linux: resources
extraFiles
Array<FileSet | string> | FileSet | string | null
Files to copy into the app’s content directory.macOS: Contents Windows/Linux: Root directory

ASAR Options

asar
AsarOptions | boolean | null
default:"true"
Whether to package source code into an ASAR archive. Can be true, false, or options object.
asarUnpack
Array<string> | string | null
Glob patterns for files to unpack from ASAR archive.Example: "**/node_modules/sharp/**/*"

Associations

fileAssociations
Array<FileAssociation> | FileAssociation
File associations for the app.
protocols
Array<Protocol> | Protocol
URL protocol schemes.

Publishing

publish
Publish
Publishing configuration. Can be a single config or array of configs.Example (GitHub):
{
  "publish": {
    "provider": "github",
    "owner": "my-org",
    "repo": "my-repo"
  }
}
Example (Multiple providers):
{
  "publish": [
    { "provider": "github" },
    { "provider": "s3", "bucket": "my-bucket" }
  ]
}
detectUpdateChannel
boolean
default:"true"
Whether to infer update channel from version pre-release components. E.g., version 1.0.0-beta.1 sets channel to beta.
generateUpdatesFilesForAllChannels
boolean
default:"false"
Whether to generate update files for all channels.
releaseInfo
ReleaseInfo
Release information.

Other Options

target
Array<string | TargetConfiguration> | string | TargetConfiguration | null
Build targets for this platform.Example:
{
  "mac": {
    "target": ["dmg", "zip"]
  }
}
electronLanguages
Array<string> | string
Electron locales to keep. By default, all locales are included.Example: ["en", "en-US", "fr"]
electronUpdaterCompatibility
string | null
The electron-updater compatibility semver range.Example: ">=2.16"

MacConfiguration

Options for building macOS applications.
category
string | null
The application category. See Apple documentation.Example: "public.app-category.developer-tools"
target
Array<string | TargetConfiguration> | string | TargetConfiguration
macOS targets.Supported targets:
  • dmg - DMG installer (default)
  • zip - ZIP archive
  • pkg - PKG installer
  • mas - Mac App Store
  • mas-dev - Mac App Store (development)
identity
string | null
The name of certificate to use when signing. Consider using environment variables instead.
icon
string | null
Path to application icon (.icns file).
entitlements
string | null
Path to entitlements file.
entitlementsInherit
string | null
Path to child entitlements file.
hardenedRuntime
boolean
default:"true"
Whether to enable hardened runtime (required for notarization).
gatekeeperAssess
boolean
default:"false"
Whether to run Gatekeeper assessment.
notarize
boolean | NotarizeOptions
Notarization options. Set to false to disable.

WindowsConfiguration

Options for building Windows applications.
target
Array<string | TargetConfiguration> | string | TargetConfiguration
Windows targets.Supported targets:
  • nsis - NSIS installer (default)
  • nsis-web - NSIS web installer
  • portable - Portable executable
  • appx - AppX (Windows Store)
  • msi - MSI installer
  • squirrel - Squirrel.Windows
icon
string | null
Path to application icon (.ico file).
publisherName
string | Array<string> | null
Publisher name for AppX packages.
certificateFile
string
Path to certificate file (.pfx).
certificatePassword
string
Certificate password. Consider using environment variable WIN_CSC_KEY_PASSWORD.
signingHashAlgorithms
Array<'sha1' | 'sha256'>
default:"['sha256']"
Signing hash algorithms.
sign
string | CustomWindowsSign
Custom signing function or path to custom signing script.

LinuxConfiguration

Options for building Linux applications.
target
Array<string | TargetConfiguration> | string | TargetConfiguration
Linux targets.Supported targets:
  • AppImage - AppImage package (default)
  • snap - Snap package
  • deb - Debian package
  • rpm - RPM package
  • pacman - Pacman package
  • flatpak - Flatpak package
category
string | null
The application category.Example: "Development", "Graphics", "Network"
icon
string
Path to application icon (PNG or ICNS).
synopsis
string | null
Short description (max 80 characters).
description
string | null
Full description.
desktop
LinuxDesktopFile
Desktop file entries.

Example: Complete Platform Configuration

{
  "appId": "com.example.app",
  "productName": "My Application",
  
  "mac": {
    "category": "public.app-category.productivity",
    "target": ["dmg", "zip"],
    "icon": "build/icon.icns",
    "hardenedRuntime": true,
    "gatekeeperAssess": false,
    "entitlements": "build/entitlements.mac.plist",
    "entitlementsInherit": "build/entitlements.mac.inherit.plist"
  },
  
  "dmg": {
    "background": "build/dmg-background.png",
    "iconSize": 100,
    "contents": [
      { "x": 410, "y": 150, "type": "link", "path": "/Applications" },
      { "x": 130, "y": 150, "type": "file" }
    ]
  },
  
  "win": {
    "target": ["nsis", "portable"],
    "icon": "build/icon.ico",
    "publisherName": "My Company"
  },
  
  "nsis": {
    "oneClick": false,
    "allowToChangeInstallationDirectory": true,
    "createDesktopShortcut": true,
    "createStartMenuShortcut": true,
    "shortcutName": "My Application"
  },
  
  "linux": {
    "target": ["AppImage", "deb"],
    "category": "Development",
    "icon": "build/icons",
    "synopsis": "A productivity application",
    "desktop": {
      "StartupNotify": "true"
    }
  },
  
  "deb": {
    "depends": ["libnotify-bin"]
  }
}

See Also

Build docs developers (and LLMs) love