1
0

Make Electron build

I historically have never liked Electron, and I don't like it now, but
unfortunately due to poor browser support, I don't have a choice to
ship anything more lightweight if I want to use the Filesystem API
as part of the packaged build, which is kind of the point.

I guess it's true:
"You either die a hero or you live long enough to become the villain."

This is an experimental build.
This commit is contained in:
2026-03-22 13:30:38 +01:00
parent c0d564b642
commit b117f3290b
7 changed files with 5091 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ tests/
playwright.config.js
run-e2e.sh
electron/
main.js # Electron main process (local HTTP server + BrowserWindow)
package.json # electron, electron-builder, build config
dist/ # Copied web/dist/ + packaged installers (gitignored)
# Root scripts
test.sh # Runs all tests (WASM + E2E)
serve-locally.sh # Serves app at localhost:8888
@@ -201,6 +206,21 @@ To automatically rebuild when source files change:
./serve-locally.sh --dev
```
## Building the Electron app
A standalone desktop app can be built from the `electron/` directory. It packages the built `web/dist/` output into an Electron shell with a local HTTP server (avoids `file://` limitations).
```bash
cd electron
npm install
npm run build:linux # Linux AppImage
npm run build:mac # macOS DMG
npm run build:win # Windows NSIS installer
npm run build # all platforms
```
Each platform script first copies `web/dist/` into `electron/dist/`, then runs electron-builder. Output goes to `electron/dist/`.
## Testing
Run all tests (WASM integration + E2E):