Skip to content

Optimize Electron release artifact size#249

Open
mrcfps wants to merge 1 commit intomainfrom
optimize-electron-dist-bundle-size
Open

Optimize Electron release artifact size#249
mrcfps wants to merge 1 commit intomainfrom
optimize-electron-dist-bundle-size

Conversation

@mrcfps
Copy link
Copy Markdown
Contributor

@mrcfps mrcfps commented May 2, 2026

Summary

  • Enable maximum Electron builder compression for macOS and Windows release artifacts.
  • Exclude Next.js build cache from the packaged web tarball.
  • Reduces the local macOS ZIP from the v0.1.0 release size (~749 MB) to ~449 MB in validation.

Validation

  • pnpm install
  • pnpm --filter @open-design/tools-pack typecheck
  • pnpm --filter @open-design/web typecheck
  • pnpm check:residual-js
  • pnpm --filter @open-design/tools-pack build
  • pnpm tools-pack mac build --to zip --namespace sizecheck --portable
  • pnpm tools-pack mac start/logs/stop --namespace sizecheck

Notes

  • pnpm test was run; existing unrelated German i18n metadata coverage failures remain in apps/web/src/i18n/content.test.ts.

@lefarcen lefarcen self-requested a review May 2, 2026 03:46
@lefarcen lefarcen added the enhancement New feature or request label May 2, 2026
Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mrcfps! Clean optimization PR β€” simple + effective. πŸ‘

The .next/cache exclusion makes perfect sense (build artifacts shouldn't ship). Compression switch is safe for Electron Builder: maximum = 7zip on macOS, NSIS built-in on Windows. Slower build, smaller artifact β€” the right trade-off for release builds.

Lens A (code correctness):
No runtime impact. Electron extracts the bundle before launch, so startup time stays the same.

Lens B (reasoning completeness):
Validation shows 749 MB β†’ 449 MB for macOS. Windows artifact size not measured, but I'd expect ~30-40% reduction there too (similar to macOS). Build-time trade-off (maybe +1-2 min for compression) is acceptable for release builds β€” we're not compressing on every dev build.

Minor observation (non-blocking):

  • The PR tested macOS artifact size. When you merge this, keep an eye on the first Windows release build to confirm similar compression gains there (you can eyeball the GitHub Actions artifact or check locally).

LGTM for merge. πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants