N
Nuxt7mo ago
Tirius

Nuxt Kit - addComponentsDir how exacly does import work ?

Docs say Register a directory to be scanned for components and imported only when used. Hello. I have a custom module that ship multiple custom components. Lets say I have a static generated Nuxt app that use that module, app have multiple pages, each page use one of the component. Does it mean that module components only be loaded by browser when I navigate to that page ? Or does it mean that only components that I have used in that app will be included in some Nuxt bundle? Thanks.
3 Replies
Tirius
TiriusOP7mo ago
Currently I don't see that my components loaded only when I navigate to the page that use them. I wonder if I miss something, or can it be optimized some how, to load only when used.
manniL
manniL7mo ago
addComponentDir works similar to the components folder. It has no difference in runtime compared ot it
Tirius
TiriusOP7mo ago
Thanks. Than all I need is Lazy prefix
Want results from more Discord servers?
Add your server