DEV Community

Cover image for Vite + Module Federation: yes, we can

Vite + Module Federation: yes, we can

Giorgio Boa on September 27, 2022

Microservices nowadays is a well-known concept and maybe you are using it in your current company. Do you know that now you can apply similar ideas...
Collapse
 
oceangravity profile image
Juan Carlos Galindo Navarro

Sadly we can't share Pina store through modules :(

Collapse
 
gioboa profile image
Giorgio Boa

Hi, are you using this plugin with Vue? Have you got a public repository for this case?

Collapse
 
oceangravity profile image
Juan Carlos Galindo Navarro

Hi Giorgio. Sorry, I commit a mistake, I was researching about Module Federation for Vite for hours, I wrote that comment at 3:50am. I sucessfully did two demos, 1 with webpack, works fine but you know, it's not Vite, and other with @originjs/vite-plugin-federation both this also works fine but it's a nigthmare in dev mode, there's no way to work with it, without doing deploying/previewing process. I saw your post, but there's is not about Vue, I know this is agnostic, but I'm really lost how I can create a demo for Vue. There's no examples with Vue, only React and Svelte :(

Thread Thread
 
gioboa profile image
Giorgio Boa

In these days I'm working on the Vue example so be patient and soon you will have good news.
The examples I did with Svelte and React are available here
github.com/module-federation/modul...

  • vite-react-microfrontends
  • vite-svelte-microfrontends
Thread Thread
 
oceangravity profile image
Juan Carlos Galindo Navarro

Oh dude, thank you so much!!!! Yeah yeah thanks, I already saw those examples, but I'm bit confused about adapters, it's really new to me. I'm wondering, this Vite plugin works like Webpack or is totally new? Again, thank you for being truly kind

Thread Thread
 
gioboa profile image
Giorgio Boa

It's a new implementation because Vite works in a different way

Collapse
 
pappijx profile image
Ayush

How to use typescript with vite module federation