DEV Community

loading...

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

Collapse
elmassimo profile image
Máximo Mussini

Nice post!

Depending on your setup, you might also be able to use the following plugin:

github.com/antfu/vite-plugin-compo...

It has worked nicely in the few projects where I've added it.

Collapse
jakedohm_34 profile image
Jake Dohm Author

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!