Replace electron with Bun compile for single-file exe distribution
This commit is contained in:
22
AGENTS.md
22
AGENTS.md
@@ -63,19 +63,23 @@ All scripts are in `package.json`.
|
||||
|
||||
## Distribution
|
||||
|
||||
## Electron single-exe distribution
|
||||
To package as a single portable exe with built-in server:
|
||||
## Single-file exe distribution
|
||||
To build a standalone executable with embedded static files:
|
||||
```bash
|
||||
cd web/electron
|
||||
npx electron-builder --win --x64
|
||||
cd web
|
||||
bun run build:exe
|
||||
```
|
||||
Output: `web/electron/release/OpenChamber.exe` (single portable exe, ~260MB)
|
||||
Output: `web/OpenChamber.exe` (~320MB single file)
|
||||
|
||||
The exe includes:
|
||||
- Bundled Node.js runtime
|
||||
- Server code, static files, and CLI
|
||||
- System tray icon with context menu
|
||||
- Auto-starts server on port 3000
|
||||
- Bun runtime
|
||||
- Server code and all dependencies
|
||||
- 300+ static files (dist/, embedded)
|
||||
- Extracts static files to temp directory on startup
|
||||
|
||||
Files involved:
|
||||
- `web/entry-singlefile.js` - Entry point for compiled exe
|
||||
- `web/embed-static.js` - Script to embed dist/ as base64
|
||||
|
||||
## Runtime entry points
|
||||
- Web bootstrap: `web/src/main.tsx`
|
||||
|
||||
Reference in New Issue
Block a user