Skip to content

fix(build): build renderer pages in separate Vite processes - #51

Closed
lynnlink wants to merge 1 commit into
mainfrom
codex/optimize-renderer-build
Closed

lynnlink wants to merge 1 commit into
mainfrom
codex/optimize-renderer-build

Conversation

@lynnlink

@lynnlink lynnlink commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

macOS packaging on main exhausted Vite's approximately 2 GiB heap while transforming the renderer. Build the main, PowerPoint, Word, and Excel pages sequentially in fresh Vite processes, and enable the Jotai debug/HMR Babel plugins only during development.

Each production page writes its assets and workers under assets/<entry>/. The orchestrator cleans output once and preserves the sibling HTML entry points expected by Electron. Update font license discovery to recurse through the new asset folders and deduplicate copied KaTeX fonts. Keep source maps for license collection.

The first three pages pass with a 2 GiB heap. Excel still exceeds that limit when built alone, so its build subprocess defaults to 4 GiB. Explicit caller limits in NODE_OPTIONS take precedence. These budgets do not change the installed application's runtime heap.

Validation:

  • Reproduced the original failure with a 2 GiB heap; removing development plugins alone did not resolve it.
  • All four sequential production builds passed with bundled Node 22.23.1 using the per-page budgets.
  • Same-runtime comparison: original combined build with 4 GiB heap took 26.24 s and peaked at 3.79 GiB RSS; sequential builds took 37.03 s and peaked at 3.55 GiB RSS. These are local measurements, not CI timings.
  • Independent builds duplicate shared dependencies: emitted assets excluding source maps grow from approximately 34.8 MiB to 47.7 MiB. Installer compression has not been measured.
  • All four HTML pages, emitted CSS asset URLs, and 1,052 static/dynamic JavaScript imports resolve; all three Office import workers exist. The license generator still discovers 59 KaTeX font files with their OFL notice.
  • Desktop suite: 2,710 passed, 6 skipped, 0 failed. Typecheck, ESLint, and git diff --check passed.

Full installer packaging and application installation have not been rerun. The change does not refactor the editor modules; further reducing Excel's heap requirement would require additional dependency/worker work.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant