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

This commit is contained in:
Elian Doran 2025-04-26 04:03:20 +03:00
parent ebb78e4ce5
commit 312288988d
No known key found for this signature in database

View File

@ -40,15 +40,21 @@ module.exports = {
...(process.platform === "darwin" ? [] : extraResourcesForPlatform) ...(process.platform === "darwin" ? [] : extraResourcesForPlatform)
], ],
ignore(copyPath) { 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; return false;
} }
if (copyPath.startsWith("/src")) { // 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; return true;
} }
}
console.log("[FORGE] ASAR: ", copyPath); // console.log("[FORGE] ASAR: ", copyPath);
return false; return false;
}, },
afterPrune: [ afterPrune: [