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

string | null
default:"com.electron.${name}"
The application ID. Used as CFBundleIdentifier for macOS and Application User Model ID for Windows (NSIS only).
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}"
string | null
The executable name. Defaults to productName. Note: On Linux, this would constitute a breaking change.
CompressionLevel | null
default:"normal"
The compression level:
  • store - No compression (fastest, largest)
  • normal - Standard compression (default)
  • maximum - Maximum compression (slowest, smallest)

File Patterns

Array<FileSet | string> | FileSet | string | null
Glob patterns for files to include in the app package.Example:
Array<FileSet | string> | FileSet | string | null
Files to copy into the app’s resources directory.macOS: Contents/Resources Windows/Linux: resources
Array<FileSet | string> | FileSet | string | null
Files to copy into the app’s content directory.macOS: Contents Windows/Linux: Root directory

ASAR Options

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

Associations

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

Publishing

Publish
Publishing configuration. Can be a single config or array of configs.Example (GitHub):
Example (Multiple providers):
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.
boolean
default:"false"
Whether to generate update files for all channels.
ReleaseInfo
Release information.

Other Options

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

MacConfiguration

Options for building macOS applications.
string | null
The application category. See Apple documentation.Example: "public.app-category.developer-tools"
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)
string | null
The name of certificate to use when signing. Consider using environment variables instead.
string | null
Path to application icon (.icns file).
string | null
Path to entitlements file.
string | null
Path to child entitlements file.
boolean
default:"true"
Whether to enable hardened runtime (required for notarization).
boolean
default:"false"
Whether to run Gatekeeper assessment.
boolean | NotarizeOptions
Notarization options. Set to false to disable.

WindowsConfiguration

Options for building Windows applications.
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
string | null
Path to application icon (.ico file).
string | Array<string> | null
Publisher name for AppX packages.
string
Path to certificate file (.pfx).
string
Certificate password. Consider using environment variable WIN_CSC_KEY_PASSWORD.
Array<'sha1' | 'sha256'>
default:"['sha256']"
Signing hash algorithms.
string | CustomWindowsSign
Custom signing function or path to custom signing script.

LinuxConfiguration

Options for building Linux applications.
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
string | null
The application category.Example: "Development", "Graphics", "Network"
string
Path to application icon (PNG or ICNS).
string | null
Short description (max 80 characters).
string | null
Full description.
LinuxDesktopFile
Desktop file entries.

Example: Complete Platform Configuration

See Also