desktop-packaging-electron-forge
Electron Forge Packaging
Quick Guide: Electron Forge v7 is the official Electron build toolchain. Configure via
forge.config.tswith typed imports from@electron-forge/shared-types. Use makers to produce platform-specific installers (Squirrel for Windows, DMG/ZIP for macOS, deb/rpm for Linux). Use publishers to upload artifacts (GitHub Releases, S3, Snapcraft). Always code-sign production builds -- macOS requires both signing and notarization. Enable Electron Fuses to harden the binary at package time. Use hooks (prePackage,postMake) for custom build logic. Electron itself MUST be adevDependency-- Forge bundles onlydependencies.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST place electron in devDependencies -- Forge provides the Electron binary during packaging; placing it in dependencies bloats the app by ~200MB)
(You MUST code-sign macOS builds with osxSign and osxNotarize in packagerConfig -- unsigned apps are blocked by Gatekeeper on macOS 10.15+)
(You MUST enable asar: true in packagerConfig -- without ASAR, your source code ships as plain-text files readable by any user)
(You MUST store signing credentials in environment variables -- never hardcode secrets in forge.config.ts)