From a8cf869179ccda2329741fd321a37f273f895ead Mon Sep 17 00:00:00 2001 From: Fredrik Rombach Ekelund Date: Wed, 20 May 2026 13:53:08 +0200 Subject: [PATCH] Exclude unnecessary items from ASAR archive --- apps/studio/forge.config.ts | 39 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/apps/studio/forge.config.ts b/apps/studio/forge.config.ts index e727e20b27..5b6f495acb 100644 --- a/apps/studio/forge.config.ts +++ b/apps/studio/forge.config.ts @@ -35,45 +35,34 @@ const config: ForgeConfig = { return {}; }, }, + // Patterns are matched against paths inside the asar root, which is + // apps/studio/ (electron-forge packages from this package). Anchor each + // pattern at the asar root with a leading slash. ignore: [ - // Exclude major development directories - /^\/\..*/, // All dotfiles and dot directories - /^\/apps\/studio\/src/, - /^\/apps\/studio\/e2e/, - /^\/apps\/cli/, - /^\/tools\/common/, - /^\/vendor/, - /^\/fastlane/, - /^\/docs/, - /^\/scripts/, - /^\/tools/, + // Dev/test sources and fixtures — runtime uses /dist instead. + /^\/\..*/, // dotfiles and dot directories + /^\/src/, + /^\/e2e/, + /^\/__mocks__/, /^\/patches/, - /^\/tools\/metrics/, - /^\/test-results/, - /^\/webpack-loaders/, - /^\/apps\/studio\/installers/, + /^\/entitlements/, + /^\/installers/, + // Build-time helpers + /^\/windowsSign\.ts$/, // Config files - /^\/webpack\./, /^\/tsconfig\./, /^\/vitest\./, - /^\/playwright\./, /^\/postcss\./, /^\/tailwind\./, /^\/forge\./, /^\/electron\./, - /^\/apps\/studio\/.*\\.config\\./, - /^\/apps\/studio\/tailwind\\.config\\.js$/, - /^\/apps\/studio\/postcss\\.config\\.js$/, - /^\/apps\/studio\/index\.html$/, - /^\/Gemfile/, + /^\/index\.html$/, /^\/.*\.md$/, /^\/.*\.txt$/, /^\/.*\.log$/, - // External resources (shouldn't be in asar) + // Resources copied separately via extraResource /^\/assets/, /^\/bin/, - /^\/apps\/cli\/dist\/cli/, - /^\/dist\/playground-cli/, ], }, rebuildConfig: {},