Skip to content

Commit fec9ca6

Browse files
committed
fix(nx/forge): rebuild not working due to ignore logic
1 parent ceb4f20 commit fec9ca6

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

apps/desktop/electron-forge/forge.config.cjs

+2-19
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,6 @@ module.exports = {
4343
// All resources should stay in Resources directory for macOS
4444
...(process.platform === "darwin" ? [] : extraResourcesForPlatform)
4545
],
46-
ignore(copyPath) {
47-
// Known files that will not be ignored and not logged.
48-
if (copyPath.startsWith("/assets") || copyPath.startsWith("/public")) {
49-
return false;
50-
}
51-
52-
// Keep only the prebuild, source code and package index.
53-
if (copyPath.startsWith("/node_modules/better-sqlite3")) {
54-
if (!copyPath.startsWith("/node_modules/better-sqlite3/build")
55-
&& copyPath !== "/node_modules/better-sqlite3/package.json"
56-
&& !copyPath.startsWith("/node_modules/better-sqlite3/lib")) {
57-
return true;
58-
}
59-
}
60-
61-
// console.log("[FORGE] ASAR: ", copyPath);
62-
return false;
63-
},
6446
afterPrune: [
6547
(buildPath, _electronVersion, _platform, _arch, callback) => {
6648
// buildPath is a temporary directory that electron-packager creates - it's in the form of
@@ -102,7 +84,8 @@ module.exports = {
10284
]
10385
},
10486
rebuildConfig: {
105-
force: true
87+
force: true,
88+
extraModules: [ "better-sqlite3" ]
10689
},
10790
makers: [
10891
{

apps/desktop/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
},
7272
"electron-forge:package": {
7373
"dependsOn": [ "build" ],
74-
"command": "pnpm exec cross-env DEBUG=electron-rebuild:* electron-forge package apps/desktop/dist"
74+
"command": "pnpm exec cross-env DEBUG=* electron-forge package apps/desktop/dist"
7575
}
7676
}
7777
}

0 commit comments

Comments
 (0)