RifloSnake
RifloSnake

Reputation: 347

How to enable Vite HMR on single-spa microfrontends app

I have a Vite React Typescript app, which uses single-spa package and hosts other microfrontend apps.

Currently, when working locally, and I make a change to the microfrontend, it doesn't reflect, and I need to manually refresh the page.

I have tried to pass hmr prop from shared store, and call the invalidate function from the hosted microfrontend to the host, but still doesn't work. Even triggering the HMR manually on the host app doesn't work, I think I should re-render/fetch the microfrontend. Even with an interval I will be happy.

Even according to the github forum of single-spa library, it is currently not supported.

Is there actually a way to achieve this spanning HMR through multiple projects?

Upvotes: 0

Views: 32

Answers (0)

Related Questions