Skip to content

perf(build): stop publishing sourcemaps (50.0MB → 16.6MB)#208

Merged
VickyXAI merged 1 commit into
mainfrom
perf/drop-published-sourcemaps
Jul 15, 2026
Merged

perf(build): stop publishing sourcemaps (50.0MB → 16.6MB)#208
VickyXAI merged 1 commit into
mainfrom
perf/drop-published-sourcemaps

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Why

Two thirds of what we publish is sourcemaps.

size
dist/index.js.map ~17MB
dist/cli.js.map ~17MB
sourcemaps total 34MB — 68% of the tarball
javascript 15MB
unpacked 50.0MB

Every npx @blockrun/clawrouter, every OpenClaw plugin install, and every package that depends on us pays that.

What

"!dist/**/*.map" in package.json files.

50.0MB → 16.6MB unpacked (3.4MB packed, 41 files).

sourcemap: true stays in tsup.config.ts — maps are still generated for local debugging and CI, they just don't ship. The bundles keep their //# sourceMappingURL= comment; a missing map is silently ignored at runtime.

Verified

Installed the packed tarball fresh:

16M   on disk (was 50M)
✓ no .map files shipped
✓ dist/cli.js --version           → 0.12.224
✓ node --enable-source-maps ...   → 0.12.224   (missing map does not crash)

No behaviour change.

Context

Found while auditing why @blockrun/mcp was paying ~50MB — about 15% of its whole 328MB install tree — for a router it never called. See blockrun-llm-ts#11, which stops installing ClawRouter for consumers that don't route. This change cuts the cost for everyone who does install it.

Summary by CodeRabbit

  • Chores
    • Updated the package to version 0.12.224.
    • Reduced the npm package size by excluding source map files from published distributions.
    • Source maps remain available for local and CI debugging.
    • Runtime behavior is unchanged.

dist/index.js.map and dist/cli.js.map were ~17MB each — 34MB of a 50MB install,
68% of the tarball — downloaded by everyone who runs npx @blockrun/clawrouter or
installs anything depending on us.

sourcemap: true stays in tsup.config.ts; maps are still generated for local
debugging and CI, they just no longer ship. The bundles keep their
sourceMappingURL comment; a missing map is silently ignored at runtime. Verified
the packed tarball runs normally and under node --enable-source-maps.

Found while auditing why @blockrun/mcp paid ~50MB (~15% of its install tree) for
a router it never called.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5260976e-0d60-43b9-8b2a-b5e08b44ecb4

📥 Commits

Reviewing files that changed from the base of the PR and between a846910 and 9ce7cdb.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • package.json

📝 Walkthrough

Walkthrough

The package version is bumped to 0.12.224, npm packaging excludes dist source maps, and the changelog documents that source maps remain available for local and CI debugging.

Changes

Release packaging

Layer / File(s) Summary
Version and npm tarball metadata
package.json, CHANGELOG.md
The package version changes to 0.12.224; dist/**/*.map files are excluded from npm packages, and the changelog records the updated packaging behavior.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: 1bcmax

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: publishing now excludes sourcemaps to reduce package size.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/drop-published-sourcemaps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VickyXAI VickyXAI merged commit 10292c0 into main Jul 15, 2026
4 checks passed
@VickyXAI VickyXAI deleted the perf/drop-published-sourcemaps branch July 15, 2026 01:46
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