#Vite + single-spa hmr not working (React)

1 messages · Page 1 of 1 (latest)

white plover
#

Has anyone figured out how to make HMR run with Vite and single-spa . My host and micro-frontend both run on Vite, and I use native imports with single-spa. Everything works apart from HMR, changes done to the micro-frontend are not updated in host app

void peak
#

Hi @white plover ! I'm also looking into how to get a good developer experience with vite + react + single-spa. Did you progress anything in your setup? How did you manage to create the spa entry point in dev mode?

I added the below but I can't find the entry point file. I assumed it would be in localhost:8181/spa.js but it's not there
vitePluginSingleSpa({
type: "mife",
serverPort: 8181,
spaEntryPoints: "src/spa.tsx",
}),

void peak
#

Lol, I found it... localhost:8181/src/spa.tsx
I was certain it would rename the file extension

#

Got it working as well but without HMR.