devtools
devtools copied to clipboard
feat(components): shortcut to find unused components
đ Your use case
In bigger projects and after refactoring/new features, having an overview which of the hundred components are still in use is not always given. Thus, it'd be amazing to figure that out through the devtools and the component tab.
đ The solution you'd like
In the component tab, having an option to list only unused components. There might be caveats with dynamic imports or similar (not sure?) but eventually, that could be shown as warning.
đ Alternatives you've considered
No response
âšī¸ Additional info
Happy to also work on the feature if people are interested in it
Does this work at all? It shows hundreds of unused components for me but I'm pretty sure they are used. Maybe It only shows as used if I'm on the same page? @antfu
@metkm I think this worked for me in the past but recently it only shows components not used on the current page indeed.
We will need to add a button like "Scan components for all routes" to allow users to bring the behavior back manually.
This sounds pretty useful !
I was thinking about having this feature, and I see that there is already a proposal.
I can only add that the same thing could be done also for composables, under the same exact reasoning.
Thanks by the way!
Sounds like an analyzer to run at buildtime.Will be interested too.
This would be amazing to have fixed again! I am trying to clean up a large Nuxt codebase with lots of dead components, and having a list of all the unused components would help a bunch.
This would definitely be very useful
@TheAlexLichter thank you for amazing idea.
Also, I think there must be a function to ignore some components from the list. Let say I have UI components and I know I will use them in the future. But other components can be safely removed.