Uh oh!
There was an error while loading. Please reload this page.
perf(build): Optimize terser minifier config for CDN bundles - #19852
perf(build): Optimize terser minifier config for CDN bundles#19852HazAT wants to merge 2 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
56e885a to
3bc0473CompareSemver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Deps
Nestjs
Node
Other
Bug Fixes 🐛Core
Nextjs
Other
Documentation 📚New Release
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Uh oh!
There was an error while loading. Please reload this page.
Enable additional terser compress and mangle options that safely reduce
the size of CDN bundle .min.js files:
- compress.passes: 5 (multi-pass finds more dead code)
- compress.ecma: 2020 (allows modern syntax: nullish coalescing, optional chaining)
- compress.toplevel: true (better variable inlining within the IIFE)
- compress.unsafe_arrows: true (function → arrow where this is unused, ~1.3KB raw)
- compress.unsafe_methods: true ({ m: function(){} } → { m(){} })
- compress.unsafe_comps/unsafe_math/pure_getters: safe algebraic opts
- mangle.toplevel: true (mangle top-level names inside IIFE scope)
Also adds 'sW' to the mangle reserved list (used by a follow-up change that
shortens the sentryWrapped function name for frame stripping).
These options only affect CDN .min.js bundles, not npm ESM/CJS output.
Saves ~300 bytes gzipped on the base browser bundle.
Co-Authored-By: Claude claude@anthropic.com3bc0473 to
05a894eCompareThis prevents the terser mangle option from mangling the 'Sentry' name, and avoids a terser bug where our top-level 'var Sentry=' gets stripped.
05a894e to
9ae982fCompareLms24
commented
Apr 9, 2026
Going to close this as the breakage with terser settings is too high |

Summary
Enable additional terser compress and mangle options that safely reduce CDN
.min.jsbundle sizes. Saves ~300 bytes gzipped on the base browser bundle.Changes
compress.passes: 5compress.ecma: 2020compress.toplevel: truecompress.unsafe_arrows: truefunctionto=>wherethisis unused (~1.3KB raw)compress.unsafe_methods: true{ m(){} }compress.unsafe_comps / unsafe_math / pure_gettersmangle.toplevel: trueThese options only affect CDN
.min.jsbundles, not npm ESM/CJS output. Theunsafe_*options are safe for our codebase because the CDN bundles run in browser contexts where the assumptions hold.Also pre-reserves
sWin the mangle list for a follow-up change.Part of #19833.
Co-Authored-By: Claude claude@anthropic.com