Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 17, 2026·3 min de lectura

Electron Builder — Package Electron Apps for Every Platform

A complete solution for packaging and distributing Electron applications, supporting auto-update, code signing, and publishing to multiple stores from a single configuration.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 29/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Electron Builder Overview
Comando de staging seguro
npx -y tokrepo@latest install d6f21152-819a-11f1-9bc6-00163e2b0d79 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introduction

Electron Builder is the standard packaging and distribution tool for Electron applications. It handles code signing, notarization, auto-update, and installer creation for macOS, Windows, and Linux from a single declarative configuration in package.json or electron-builder.yml.

What Electron Builder Does

  • Creates native installers: DMG and PKG for macOS, NSIS and MSI for Windows, AppImage, deb, rpm, and snap for Linux
  • Signs and notarizes macOS builds with Apple Developer credentials
  • Signs Windows executables with EV or standard code-signing certificates
  • Generates auto-update metadata for seamless in-app updates via electron-updater
  • Publishes artifacts to GitHub Releases, S3, or custom update servers

Architecture Overview

Electron Builder reads a declarative config that specifies per-platform targets, then orchestrates a build pipeline: it copies the app source, installs production dependencies, compiles native modules for the target arch, applies code signing, and finally invokes platform-specific packaging tools (NSIS, appdmg, rpmbuild) to produce distributable installers.

Self-Hosting and Configuration

  • Add an electron-builder.yml or a build key in package.json to configure targets
  • Set CSC_LINK and CSC_KEY_PASSWORD environment variables for code signing
  • Use publish configuration to target GitHub Releases, S3, or a generic server
  • Multi-arch builds (x64 and arm64) are supported via the --arch flag
  • CI integration works out of the box with GitHub Actions, GitLab CI, and CircleCI

Key Features

  • Single config file drives all platforms and architectures
  • Differential updates reduce download sizes for returning users
  • Native module rebuilding for the target Electron version is automatic
  • ASAR packing with optional per-file unpack rules for performance
  • Monorepo-friendly with workspace and custom directory support

Comparison with Similar Tools

  • Electron Forge — offers a more opinionated plugin-based workflow; Electron Builder gives finer control over installer output
  • electron-packager — lower-level tool that only bundles the app without creating installers or handling signing
  • Tauri — Rust-based alternative to Electron itself, not a packaging tool for existing Electron apps
  • pkg — packages Node.js apps into executables but does not target the Electron runtime

FAQ

Q: Can I build for macOS from a Linux CI runner? A: DMG and PKG targets require macOS. You can build non-signed zip targets on Linux but notarization needs a Mac.

Q: How does auto-update work? A: Electron Builder generates update metadata files. The companion library electron-updater checks these files at runtime and applies delta or full updates.

Q: Is ASAR packing required? A: No, but it is enabled by default. It bundles app files into a single archive for faster reads and to prevent casual source inspection.

Q: Does it support Apple Silicon natively? A: Yes. Pass --arm64 or --universal to produce native Apple Silicon or universal binaries.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados