fix: stage rebuilt better-sqlite3 for Electron packaging

Rebuilds better-sqlite3 separately for Electron before packaging
Copies the native binary into the packaged app resources
Updates packaging docs to explain the afterPack workaround
This commit is contained in:
Bohdan Triapitsyn
2026-07-28 14:05:03 +03:00
parent fbc064c16f
commit 92abdefea8
3 changed files with 35 additions and 5 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ That runs, in order:
2. `prepare:opencode-cli` to download/cache the pinned OpenCode CLI and copy it into `packages/electron/resources/opencode-cli`.
3. `bundle:main` to create `packages/electron/dist-bundle/main.mjs`.
4. `rebuild:native` to rebuild native modules for Electron.
5. `package.mjs` to run `electron-builder`.
5. `package.mjs` to run `electron-builder`; its `afterPack` hook stages the rebuilt `better-sqlite3` binary that Electron Builder's Bun dependency collector otherwise omits.
Build output goes to `packages/electron/dist`.