Can tree shaking be improved for named imports?
See original GitHub issueIf I import
import { Github } from "@icons-pack/react-simple-icons";
webpack packs whole library (2MB+).
If i import only one file
import Github from "@icons-pack/react-simple-icons/lib/Github";
only icon I need (few kB).
I would expect for named imports to get tree shaken and pack only files that are needed.
Thanks for the lib, btw 😉
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Reduce JavaScript payloads with tree shaking - web.dev
In production builds, webpack can be configured to "shake" off exports from ES6 modules that weren't explicitly imported, making those production builds ...
Read more >Tree-Shaking: A Reference Guide - Smashing Magazine
It will split all member and named exports into default exports, allowing the modules to be evaluated individually. It also has a configuration ......
Read more >Tree shaking and code splitting in webpack - LogRocket Blog
Tree shaking dynamic imports Dynamic imports resolve the entire module — with its default and named exports — without tree shaking unused ......
Read more >JavaScript tree shaking, like a pro | by Daniel Brain - Medium
Tree shaking in JavaScript is becoming an essential practice, to avoid large bundle sizes and improve performance.
Read more >Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Version
3.0.0-alpha.0
looks fine to me, tree shaking works. 😃@pomali We have a
Pr
#39 with the fix of the issue that I report.Thanks @pomali for your issue, any collaboration is free to contribute whatever it wants.
wait for the new version…