Skip to content
Snippets Groups Projects
Unverified Commit ae01066f authored by Michael Clark's avatar Michael Clark Committed by GitHub
Browse files

:electron: Reduce package size (#3443)

* reduce package size of all packages

* release notes

* Update beforePackHook.ts
parent fefd1be2
No related branches found
No related tags found
No related merge requests found
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 build
......
......@@ -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": {
......
---
category: Maintenance
authors: [MikesGlitch]
---
Reduce size of desktop packages
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment