
We’ve all heard it:
“It’s fine, unused code gets tree-shaken out.”
But here’s the truth…
Your bundle is lying to you.
And tree-shaking isn't t...
For further actions, you may consider blocking this person and/or reporting abuse
yeah this is honestly spot on, every time i think the build is clean something sneaks in - you think there's a way to really trust your bundle or is it just endless checking?
Right? It always feels like a game of whack-a-mole 😅
I don’t think it ever gets to set-it-and-forget-it — but setting up a visualizer in your CI (like source-map-explorer or vite-plugin-visualizer) helps catch sneaky changes early.
Not perfect, but way better than chasing surprises after deploy.
Great article. Thanks for sharing!
Thanks @fstrube !
Great post @abhinavshinoy90 !
Thanks @javascriptwizzard
So true about side effects sneaking into bundles, even when you think you’ve done everything right. What’s the sneakiest thing you’ve found lurking in your own builds?
One time it was a datepicker that pulled in all of Moment.js, just from one import 😬
We thought we were safe, but it added 200KB+ until we caught it in the analyzer!
Pretty cool, honestly makes me second guess how much I rely on my build tools without actually checking what's in there
Totally get that — build tools are powerful, but they can lull you into a false sense of security. A quick peek at the bundle now and then can be super eye-opening!
Great article
Thanks @vetriselvan_11