Support Tree Shaking / Modularized Imports (React)
See original GitHub issueCurrently, the React build produces a single index.cjs.js
/ index.esm.js
file including all icons. This is fine for some use cases but can cause bundle bloat / dev server slowness. It would be awesome if each icon was additionally put in its own file so they can be tree shaken effectively by a bundler. This would also allow something like Next.js to use the modularizeImports
feature to not bundle every single icon in both the development and production build.
Example:
"@tabler/icons": {
"transform": "@tabler/icons/{{member}}"
}
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Tree-Shaking Basics for React Applications - Telerik
Tree -shaking is an important way to reduce the size of your bundle and improve performance. See how you can do it in...
Read more >Minimizing Bundle Size - React Suite
Tree Shaking is a method of optimizing the volume by removing unused code in the final file. The components must be imported via...
Read more >Tree shaking and code splitting in webpack - LogRocket Blog
To dynamically import a node module and tree shake it, we can first create a module that only exports what we want, then...
Read more >Tree shaking - The newline Guide to Creating a React Hooks ...
Tree shaking is the process of removing unused code from your bundle. When you develop your modern web app, you usually use tools...
Read more >What is Tree Shaking and Implementation in React - Folio3
Rollup statically analyzes the code you are importing, and will exclude anything that isn't actually used.
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 Free
Top 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
I’m working on it here: https://github.com/tabler/tabler-icons/pull/378 😃
That’s pretty important