0

I'm doing a POC combining Vite plugin federation and Turbo repo for work (mostly as an alternative to single-spa, using Vite). As mentioned in Vite plugin federation's documentation:

Only the Host side supports dev mode, the Remote side requires the RemoteEntry.js package to be generated using vite build. This is because Vite Dev mode is Bundleless and you can use vite build --watch to achieve a hot update effect.

I already got a host and a remote app working, but I noticed that my remote app is not rebuilding after a second change is introduced in the code base. Am I missing something? Maybe something broken in my vite config?

To reproduce this, you can clone my repository and run the following steps.

  1. cd into apps/host
  2. run pnpm dev in terminal window.
  3. cd into apps/remote
  4. run pnpm build:watch in a terminal window.
  5. run pnpm preview in a terminal window.

If you would rather not try this, here's a demo with the issue in question.

In here the following happened.

  1. Made a change in a header: Remote React TS + Tailwind = Love → Remote React TS + Tailwind.
  2. Change was detected by vite build, and a rebuild was triggered.
  3. Made another change: Remote React TS + Tailwind. → Remote React TS + Tailwind is awesome!
  4. Change was NOT detected by vite build.
Jeremy
  • 1,447
  • 20
  • 40

0 Answers0