English
Overview
What is electronup?
electronup is a command-line build tool for Electron applications. It wires the renderer, the main process, preload scripts and installer packaging into a single workflow:
- The renderer is built and hot-reloaded by Vite.
- The main process is built and watched by Vite in SSR (Node) mode.
- Preload scripts are built with Vite as well.
- Installers are produced by electron-builder.
You only need to maintain one electronup.config.ts file in the project root. Most common options of the underlying tools are preset, and most presets can be overridden.
TypeScript recommended
The main process and preload scripts are built with Vite. The main entry defaults to ${mainDir}/index.ts; index.mts / index.cts / index.js / index.mjs / index.cjs also work (the first existing one in this order wins). electronup.config.ts is the recommended config file.
What it does
| Capability | Description |
|---|---|
| Dev server | Starts a Vite dev server, watches the main process and launches / restarts Electron after a successful build |
| Build | Builds the renderer, preload scripts and main process, then calls electron-builder |
| Path conventions | Manages render, main, public, lib, resource output and installer output |
| Environment variables | Loads .env and .env.{mode} from the project root, injects them into the main process and preload scripts; VITE_-prefixed variables are available in the renderer |
| Platform selection | Defaults to the current platform and architecture, with CLI flags and an interactive wizard |
| Update helpers | Exports initAutoUpdater, checkForUpdates and autoUpdater to simplify electron-updater integration |
What it does not do
To avoid confusion:
- It does not install or pin Electron.
electronis an optional peer dependency installed and versioned by your app. electronup reads the installed version when building. - It does not provide runtime helpers for windows, menus, trays or IPC. Those live in the runtime packages under
packages/electron-*in this repository. See the plugin overview. - It does not replace the full documentation of Vite or electron-builder. electronup presets and orchestrates them; refer to their docs for uncovered options.
- It does not manage code signing certificates. macOS notarization and Windows code signing still depend on electron-builder configuration and your certificate setup; see Code signing and notarization.
Requirements
| Dependency | Requirement |
|---|---|
| Node.js | ^22.18.0 || ^24.11.0 || >=26.0.0 (see engines in packages/electronup/package.json) |
| Package manager | npm, yarn or pnpm |
| Electron | >= 28 recommended; installed by your app |
| TypeScript | Main and preload entries must be TypeScript |
| Git | Only needed when create-electronup pulls a remote template |
Installation
bash
npm install electronup -Dbash
yarn add electronup -Dbash
pnpm add electronup -Delectronup already depends on vite, electron-builder and friends. Your app usually only needs electron and typescript:
json
{
"devDependencies": {
"electron": "^40.6.1",
"electronup": "^0.4.0",
"typescript": "^5.9.3"
}
}Features
- Multiple templates:
create-electronupsupportsvanilla,vue,react,react-swcandsolid. - Two-process dev experience: renderer HMR; main process rebuilds and restarts Electron on change.
- Unified environment variables:
.env/.env.{mode}are loaded with dotenv and injected into the main process and preload scripts; the renderer can useVITE_-prefixed variables. - Single-file config:
electronup.config.tsmanages paths, Vite, pack, preload scripts and electron-builder. - Platform aware: builds for the current OS and architecture by default; Windows / macOS / Linux and their architectures can be selected explicitly.
- Overridable presets: paths,
viteConfig,packConfigandbuilderConfigfollow documented merge rules. - Inspectable output:
electronup-effective-config.yamlis written to the output directory after each build.
Related packages
| Package | Purpose |
|---|---|
electronup | The CLI and config API documented here |
create-electronup | Creates a project from a remote template |
@quiteer/parser-config | Parses electronup.config.ts and other config files |
@quiteer/electron-* | Optional runtime packages for windows, menus, trays, IPC, preload, app lifecycle and shortcuts |
Platform limitations
These limitations come from electron-builder or the current implementation:
- macOS installers can only be built on macOS.
- Linux packages cannot be built on Windows.
- The interactive wizard does not offer Windows when running on Linux. The non-interactive CLI does not block
--winon Linux, but success depends on the host toolchain (for example Wine). - Only one platform is built per run. Run the build multiple times for multiple platforms.
See the CLI reference for all flags and Configuration for details.
Electron community group (Chinese): 12354891