Importing entire libraries instead of specific functions bloats bundle size
6/10 MediumDevelopers commonly import entire libraries when only needing single functions, pulling in 70+ kilobytes of unused code (e.g., lodash). Combined with full icon libraries, moment.js for dates, and analytics packages with unwanted dependencies, this significantly increases bundle size and degrades performance.
Sources
- Svelte: Why Developers Are Switching To It in 2025 π€
- Is Next.js Really Broken in 2025?
- The Case for Less JavaScript in 2025 - Cerebrix
- Stop Using Ruby on Rails Like It's 2014: Modern Patterns ...
- JavaScript in 2025: The Good, The Bad, and Whatβs Next
- 5 Painful Next.js Performance Killers (and how to fix them)
Collection History
I've seen apps serving 15MB of uncompressed JavaScript. Your users are literally downloading your entire codebase... Enable gzip compression (1 line in nginx), Use CDN for static assets, Lazy load non-critical components, Tree-shake unused dependencies
It's quite big bundle files because all of them are using the wrappers to thumb, other functions that are importing other functions... A lot of the repeated code and a lot of the methods are reusing, and a lot of the methods are taken that are not important right now.
Bundle Size Bloat: Many production apps ship with oversized bundles, often due to careless dependencies, poor tree-shaking, or legacy code.
The most common culprit is importing entire libraries when you only need one function. For example, writing import from load dash pulls in 70 kilobytes when you probably only needed one 2 kilobyte function.