DEV Community

Discussion on: Auto-registering all your components in Vue 3 with Vite

Collapse
 
jakedohm_34 profile image
Jake Dohm

Hey Máximo! Yes, that's a super neat plugin.

That plugin works really nicely when all of your code is within JavaScript, like Single File Components. In my case, I'm using Vue components in twig/html that isn't processed by the Vue template compiler. So, I have to globally register them on the Vue instance.

So yeah, depends on the use-case but both are good!

Collapse
 
samsour profile image
samsour

This also works totally well in combination. Imagine you no longer have any component imports in your SFCs. Nevertheless, you have "exposable components" that you then register globally, which you can use in Twig/html. The components contained in them are automatically resolved.