N
Nuxt4w 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
Tirius4w 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
manniL4w ago
addComponentDir works similar to the components folder. It has no difference in runtime compared ot it
Tirius
Tirius4w ago
Thanks. Than all I need is Lazy prefix