Skip to content

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 ​

CapabilityDescription
Dev serverStarts a Vite dev server, watches the main process and launches / restarts Electron after a successful build
BuildBuilds the renderer, preload scripts and main process, then calls electron-builder
Path conventionsManages render, main, public, lib, resource output and installer output
Environment variablesLoads .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 selectionDefaults to the current platform and architecture, with CLI flags and an interactive wizard
Update helpersExports initAutoUpdater, checkForUpdates and autoUpdater to simplify electron-updater integration

What it does not do ​

To avoid confusion:

  • It does not install or pin Electron. electron is 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 ​

DependencyRequirement
Node.js^22.18.0 || ^24.11.0 || >=26.0.0 (see engines in packages/electronup/package.json)
Package managernpm, yarn or pnpm
Electron>= 28 recommended; installed by your app
TypeScriptMain and preload entries must be TypeScript
GitOnly needed when create-electronup pulls a remote template

Installation ​

bash
npm install electronup -D
bash
yarn add electronup -D
bash
pnpm add electronup -D

electronup 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-electronup supports vanilla, vue, react, react-swc and solid.
  • 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 use VITE_-prefixed variables.
  • Single-file config: electronup.config.ts manages 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, packConfig and builderConfig follow documented merge rules.
  • Inspectable output: electronup-effective-config.yaml is written to the output directory after each build.
PackagePurpose
electronupThe CLI and config API documented here
create-electronupCreates a project from a remote template
@quiteer/parser-configParses 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 --win on 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 groupElectron community group (Chinese): 12354891

Released under the MIT License.