Removed inline source maps from image dependencies - #30706
Conversation
no ref Inline maps retain large source strings in the production heap even though Ghost does not use them. Strip only trailing map comments in the image profile, preserve executable bytes and external references, and expose per-package savings in the image report.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 10m 9s | View ↗ |
nx run ghost:test:ci:integration |
✅ Succeeded | 3m 37s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 55s | View ↗ |
nx run ghost:test:ci:e2e |
✅ Succeeded | 3m 19s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 3m 14s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 22s | View ↗ |
nx run @tryghost/koenig-lexical:test:acceptance |
✅ Succeeded | 1m 51s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 41s | View ↗ |
Additional runs (11) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-09-12 01:26:52 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30706 +/- ##
==========================================
+ Coverage 67.66% 67.71% +0.04%
==========================================
Files 1676 1676
Lines 60517 60517
Branches 10465 10465
==========================================
+ Hits 40950 40980 +30
+ Misses 17249 17218 -31
- Partials 2318 2319 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Inline source maps retain large module-source strings in the production heap even though Ghost does not use them. The image prune profile now removes final inline JSON source-map comments from deployed JavaScript dependencies, including the charset=utf-8 variant. External map references and executable content are preserved; archive pruning is unchanged.
The image report includes per-package inline-map savings, and its existing surviving-byte totals reflect the reduction. Files are replaced rather than edited in place to protect hard-linked pnpm store contents.
Validation:
docker build -f Dockerfile.production --target report: 197,443,071 → 193,822,237 bytes (3,620,834 bytes smaller), with 29,232 surviving files in both builds. Inline maps account for 3,623,488 removed bytes; the updated prune script accounts for the small difference. Both native-module checks passed.pnpm checkencountered a missing local Firefox binary and two gift-preview test timeouts. Both timeout tests passed on isolated reruns.e5caf4c5edand PR mergedea004d9ed(parents are the baseline and this PR's50fc0322b4). Same dataset and workload, profiling disabled in both runs.boot.heap_used_bytesThese are observations from one paired run, not an estimate of statistical significance. Calibration was 372 → 359 ms; both runs had zero failed load requests and negligible host steal.
CI: browser E2E checks passed. Both MySQL acceptance jobs failed when Docker could not pull
minio/minio(pull access denied), after the test suite completed; this is an infrastructure failure.Mailgun remains at its existing version. The newer 14.0.1 Node bundle has no inline map, but upgrading also changes the CommonJS import contract and crosses several major versions.