Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 17, 2026·3 min de lecture

Electron Forge — All-in-One Toolchain for Building Electron Apps

The official Electron project scaffolding and build tool that unifies app creation, development, packaging, and distribution through a plugin-based pipeline.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Electron Forge Overview
Commande d'installation directe
npx -y tokrepo@latest install 9302149e-819b-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Electron Forge is the official, all-in-one toolchain for building Electron applications, maintained by the Electron team. It handles project scaffolding, local development with hot reload, packaging into platform-native bundles, and publishing to distribution channels, all driven by a plugin-based configuration.

What Electron Forge Does

  • Scaffolds new Electron projects with templates for vanilla JS, TypeScript, React, Vue, and Webpack or Vite
  • Runs a development server with live reload and source map support
  • Packages applications into platform-specific bundles (app, exe, or directory)
  • Creates distributable installers using Makers for DMG, Squirrel, deb, rpm, snap, and Flatpak
  • Publishes artifacts to GitHub Releases, S3, Electron Release Server, or custom targets

Architecture Overview

Electron Forge is built around a plugin architecture with four hook points: Template, Plugin, Maker, and Publisher. Templates generate the initial project structure. Plugins modify the build pipeline (e.g., integrating Vite or Webpack). Makers convert the packaged app into distributable formats. Publishers upload the final artifacts to release channels. The Forge CLI orchestrates these components through lifecycle commands: init, start, package, make, and publish.

Self-Hosting and Configuration

  • Initialize with npm init electron-app@latest and select a template
  • Configure makers and publishers in forge.config.js or forge.config.ts
  • Use the Vite plugin for modern bundling or the Webpack plugin for legacy setups
  • Set code-signing environment variables for macOS notarization and Windows signing
  • Integrate with CI by running npx electron-forge make in your pipeline

Key Features

  • Official Electron tooling with first-party maintenance and compatibility guarantees
  • Template system supports React, Vue, Svelte, and custom starters
  • Vite integration provides fast builds with hot module replacement in development
  • Extensible plugin API lets you hook into every stage of the build lifecycle
  • Built-in Squirrel.Windows and macOS auto-update support

Comparison with Similar Tools

  • Electron Builder — focuses on packaging and distribution with extensive installer options; Forge covers the full lifecycle from scaffolding to publishing
  • electron-packager — low-level packaging tool without installer creation; Forge wraps and extends it
  • Vite — a general web bundler; Forge integrates Vite specifically for the Electron development workflow
  • Tauri — a Rust-based alternative framework to Electron itself, not a compatible build tool

FAQ

Q: Is Electron Forge the recommended way to build Electron apps? A: Yes. The Electron documentation recommends Forge as the primary build tool for new projects.

Q: Can I migrate an existing Electron project to Forge? A: Yes. Run npx @electron-forge/cli import in your project directory to add Forge configuration to an existing app.

Q: Does Forge support Apple Silicon? A: Yes. Forge can build universal, x64, or arm64 binaries for macOS through its maker configuration.

Q: How do I add a custom maker? A: Implement the MakerBase interface and register it in forge.config.js. Custom makers can produce any artifact format you need.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires