Tree Shakeable Injector
See original GitHub issueHey! Love the project, working great for me. However I’d like to be able to tree-shake my styles with my components. For instance, if I had 10 components, all 10 groups of styles would be injected even if only 3 components are used on a page.
I like the approach here where
<div className={style.myThing} />
Becomes
<div className={style().myThing} />
Out of the box that package doesn’t work with rollup-plugin-styles. I’m trying to experiment with a custom injector to do it, but no luck just yet.
Is this something you’d consider adding as a built in option?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
TreeShakeableTokens Docs.md - gists · GitHub
Tree -shakeable Tokens Docs. Status quo and issues with it. Injector structure. Currently, to provide services in Angular, you include them in an...
Read more >Tree Shakable Services and Lightweight Injection Tokens ...
In this article we will discuss the concept of tree shaking and how angular handles tree shaking in general and specifically for services....
Read more >Tree-shakable dependencies in Angular projects
The inject function injects dependencies from the module injector in which it's provided—in this example the root module injector. It can be ...
Read more >Tree Shakeable Providers and Services in Angular - Cory Rylan
Let's look at an example of how we would have registered a Service in previous Angular versions to be used for dependency injection....
Read more >How to build tree-shakeable JavaScript libraries - Cube Blog
In this tree-shakable implementation, dependency injection via Chart.register is used. Library code is very well split into individual parts ...
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
Seems to be working just great so far. Will make additional issues later if I discover any functionality that is missing. Thanks for the hard work. 🙌
Already installed and trying it now. I’ll let you know if it’s doing what I expect!