An Electron Forge wrapper that turns any static website into a desktop application. Drop your pre-built site into the project, tweak the branding assets, and ship cross-platform packages via Electron.
- macOS, Windows, or Linux with Node.js 18+ and npm 9+
- Git (optional, but recommended)
- Bundled static website output (HTML/CSS/JS) ready to embed
- Install dependencies:
npm install
- Run the app in development mode with live reload:
npm start
Follow these steps every time you want to bundle a new static site build into the Electron shell:
-
Copy your site into
dist/:- Build your static site with your favorite framework (Next.js, Vite, Astro, etc.).
- Remove any previous contents inside
dist/in this repository. - Paste the latest build artifacts (HTML, CSS, JS, assets) directly under
dist/.
-
Replace branding assets under
assets/:- Update
assets/icon.png(and other icon sizes if present) with your app icon. - Swap the background artwork files (for example
assets/background.png) so installer windows and splash screens show the correct branding. - Keep file names and dimensions consistent unless you also update the Electron Forge maker configuration.
- Update
-
Update metadata in
package.json:- Change
name,productName, anddescriptionto match the new project. - Optionally adjust
author,version, and any custom fields you surface in auto-updaters or installers. - Save the file so Electron Forge uses the latest metadata when creating distributables.
- Change
npm run package– Creates unpacked builds for the current platform.npm run make– Produces installers/DMGs/ZIPs based on the makers configured inforge.config.js.npm run make-universal(macOS only) – Produces a universal binary for Apple Silicon and Intel.npm run publish– Runs the publish pipeline defined in Electron Forge (configure targets before use).
Artifacts appear under the out/ directory. Always test the generated installer on a clean machine or VM before distributing.
- Adjust Electron main process behavior in
src/index.jsand preload logic insrc/preload.js. - Review
forge.config.jsto tweak makers, DMG backgrounds, Squirrel settings, or code-signing hooks. - Consider wiring your CI/CD pipeline to run
npm ci && npm run makeso releases remain reproducible.
- If the app launches but shows a blank window, ensure your static files exist under
dist/and that the entryindex.htmlpath matches whatsrc/index.jsloads. - When icons appear pixelated, provide higher-resolution PNG/ICNS files in
assets/and update the Forge makers accordingly. - For signing or notarization issues on macOS, integrate your Apple Developer credentials into the Forge configuration or use
electron-osx-signhooks.