Skip to content

Build your personal knowledge base with Trilium Notes

feat(nx/forge): reduce size of better-sqlite3

Elian Doran312288988d61
diff --git a/apps/desktop/electron-forge/forge.config.cjs b/apps/desktop/electron-forge/forge.config.cjs
index a2a72bd901..0febb4a5e0 100644
--- a/apps/desktop/electron-forge/forge.config.cjs
+++ b/apps/desktop/electron-forge/forge.config.cjs
@@ -40,15 +40,21 @@ module.exports = {
...(process.platform === "darwin" ? [] : extraResourcesForPlatform)
],
ignore(copyPath) {
- if (copyPath.startsWith("/dist")) {
+ // Known files that will not be ignored and not logged.
+ if (copyPath.startsWith("/assets") || copyPath.startsWith("/public")) {
return false;
}
- if (copyPath.startsWith("/src")) {
- return true;
+ // Keep only the prebuild, source code and package index.
+ if (copyPath.startsWith("/node_modules/better-sqlite3")) {
+ if (!copyPath.startsWith("/node_modules/better-sqlite3/build")
+ && copyPath !== "/node_modules/better-sqlite3/package.json"
+ && !copyPath.startsWith("/node_modules/better-sqlite3/lib")) {
+ return true;
+ }
}
- console.log("[FORGE] ASAR: ", copyPath);
+ // console.log("[FORGE] ASAR: ", copyPath);
return false;
},
afterPrune: [