AgentSkillsCN

electron-forge

通过完整的构建流水线打包并分发Electron应用。在搭建脚手架、配置制作人/发布者/插件,或扩展Forge时使用此功能。

SKILL.md
--- frontmatter
name: electron-forge
description: Package and distribute Electron apps with a full build pipeline. Use when scaffolding, configuring makers/publishers/plugins, or extending Forge.
metadata:
  author: hairy
  version: "2026.1.30"
  source: Generated from https://github.com/electron-forge/electron-forge-docs, scripts located at https://github.com/antfu/skills

Electron Forge is an all-in-one tool for packaging and distributing Electron applications. It combines packaging, code signing, installers, and publishing into one pipeline and supports custom plugins, makers, and publishers.

Skills are based on Electron Forge (docs as of 2026-01-30), generated from electron-forge-docs.

Core References

TopicDescriptionReference
Why Electron ForgeMotivation, value proposition, Forge vs Buildercore-why-electron-forge
Build LifecyclePackage → Make → Publish; hooks; cross-platformcore-build-lifecycle
CLIInit, import, package, make, publish, start; flags; programmatic APIcore-cli

Configuration

TopicDescriptionReference
Configurationforge.config.js, packagerConfig, makers, publishers, plugins, hooks, buildIdentifierconfig-configuration
HooksgenerateAssets, preStart, postPackage, preMake, postMake, readPackageJson, etc.config-hooks
TypeScript configforge.config.ts, ForgeConfig, constructor syntaxconfig-typescript
Plugins overviewBundler (Webpack, Vite) and utility pluginsconfig-plugins-overview
Webpack pluginmain/renderer config, magic globals, HMR, native modulesconfig-plugins-webpack
Vite pluginbuild/renderer entries, HMR globals, native externalsconfig-plugins-vite
Makers overviewConfig, platforms; DMG, ZIP, Squirrel, deb, rpm, etc.config-makers-overview
Publishers overviewGitHub, S3, Nucleus; config; auto-updateconfig-publishers-overview

Features

TopicDescriptionReference
Import existing projectimport command and manual setupfeatures-import-existing-project
Built-in templateswebpack, vite, TypeScript variants; create-electron-appfeatures-templates

Guides

TopicDescriptionReference
Code signingmacOS and Windows; where to configureguides-code-signing

Advanced

TopicDescriptionReference
Auto updateupdate.electronjs.org, S3, custom servers (Nucleus, etc.)advanced-auto-update
DebuggingMain process: CLI, VS Code, JetBrainsadvanced-debugging
Writing pluginsPluginBase, getHooks, startLogicadvanced-extending-plugins
Writing makersMakerBase, isSupportedOnCurrentPlatform, makeadvanced-extending-makers
Writing publishersPublisherBase, publish; multi-call behavioradvanced-extending-publishers
Writing templatesForgeTemplate, requiredForgeVersion, initializeTemplateadvanced-extending-templates