A local-first personal finance app
:electron: Reduce package size (#3443)
Michael Clarkae01066fe2e3
diff --git a/packages/desktop-electron/beforePackHook.ts b/packages/desktop-electron/beforePackHook.tsindex 3446378e70..fec75de369 100644--- a/packages/desktop-electron/beforePackHook.ts+++ b/packages/desktop-electron/beforePackHook.ts@@ -1,4 +1,5 @@import { rebuild } from '@electron/rebuild';+import copyFiles from 'copyfiles';import { Arch, AfterPackContext } from 'electron-builder';/* The beforePackHook runs before packing the Electron app for an architecture@@ -26,6 +27,16 @@ const beforePackHook = async (context: AfterPackContext) => {});console.info(`Rebuilt better-sqlite3 with ${arch}!`);++ if (context.packager.platform.name === 'windows') {+ console.info(`Windows build - copying appx files...`);++ await new Promise(resolve =>+ copyFiles(['./appx/**/*', './build'], { error: true }, resolve),+ );++ console.info(`Copied appx files!`);+ }} catch (err) {console.error('beforePackHook:', err);process.exit(); // End the process - unsuccessful builddiff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.jsonindex c561de7724..960b789e90 100644--- a/packages/desktop-electron/package.json+++ b/packages/desktop-electron/package.json@@ -9,20 +9,22 @@"update-client": "bin/update-client","build": "yarn build:dist && electron-builder","build:dist": "tsc --p tsconfig.dist.json && yarn copy-static-assets",- "copy-static-assets": "copyfiles --exclude 'build/**/*' **/*.html icons/**/* appx/**/* build",+ "copy-static-assets": "copyfiles --exclude 'build/**/*' **/*.html icons/**/* build","watch": "yarn build:dist && cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron ."},"main": "build/index.js","build": {"appId": "com.actualbudget.actual","files": [+ "build","!node_modules/loot-core/src{,/**/*}","!node_modules/loot-core/lib-dist/{browser,bundle.mobile*}",- "!**/*.js.map",- "!node_modules/@jlongster/sql.js","!node_modules/absurd-sql","!node_modules/better-sqlite3/{benchmark,src,bin,docs,deps,build/Release/obj,build/Release/sqlite3.a,build/Release/test_extension.node}",- "build"+ "!**/*.js.map",+ "!**/stats.json",+ "!node_modules/@jlongster/sql.js/**/*",+ "!build/client-build/sql-wasm.wasm"],"beforePack": "./build/beforePackHook.js","mac": {diff --git a/upcoming-release-notes/3443.md b/upcoming-release-notes/3443.mdnew file mode 100644index 0000000000..4c1fbda361--- /dev/null+++ b/upcoming-release-notes/3443.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [MikesGlitch]+---++Reduce size of desktop packages