Repository navigation
fix(build): patch tsup dts cache bug that ran release builds out of memory - #1202
Merged
Merged
Conversation
…emory tsup's getCompilerOptions keeps the input folder as dirName on a cache hit when a tsconfig path is passed, so rollup-plugin-dts builds a new TypeScript program per source folder. The release build of 1.0.0-alpha.131 hit the 12 GB heap limit. With the fix the declaration build takes ~9s and ~1.3 GB; API reports are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Release workflow for
1.0.0-alpha.131failed withERR_WORKER_OUT_OF_MEMORYduring the declaration build.Cause: in
tsup/dist/rollup.js,getCompilerOptionskeeps the input file's folder asdirNameon a cache hit when a tsconfig path is passed (tsup always passes one). The dts plugin comparesdirNameto decide whether it can reuse its TypeScript program, so it builds a fresh program for every source folder. Memory grows with the number of folders, and the Profile PR's new integration folders pushed it past 12 GB. PR CI builds with--no-dts, so only the release hit it.Fix:
scripts/patch-tsup.mjsapplies the one-line fix beforenpm run build. It is idempotent and fails loudly if a tsup upgrade moves the code. No new dependency.Checked locally: full build passes in ~10s at ~1.3 GB peak (was >12 GB).
npm run api:check: all 26 reports unchanged, so the published declarations are identical.🤖 Generated with Claude Code