Hello Team,
I am using Vite with Module Federation via vite-plugin-federation in a micro-frontend architecture (origin-based federation).
Current Setup
Producer App (Remote)
- Exposes modules via Module Federation.
- Generates
remoteEntry.js only during vite build.
- Must run
vite build before the host can consume it.
- To serve it, I must run
vite preview.
-
Consumer App (Host)
- Runs using
pnpm dev.
- HMR works correctly within the host application.
- Consumes
remoteEntry.js from the producer.
Problem
In development mode:
-
The producer app does not support HMR for exposed modules.
-
Any change in the producer requires:
- Re-running
vite build
- Restarting
vite preview
-
The consumer app must then re-fetch the updated remoteEntry.js.
This leads to:
In contrast, the consumer (host) app benefits from Vite’s excellent HMR, but the remote app does not.
Expected Behavior
It would significantly improve developer experience if:
-
The producer app could run in dev mode
-
remoteEntry.js could be dynamically generated in memory (similar to Webpack dev server)
-
HMR updates from producer propagate to consumer without requiring:
- Full rebuild
- Preview restart
- Manual refresh
Essentially, enabling cross-application HMR in a federated Vite setup.
Why This Matters
In real-world micro-frontend systems:
- Multiple independent teams work on remotes
- Fast feedback cycles are critical
- Rebuilding and restarting services repeatedly impacts productivity
#Question
Is there:
- A recommended dev-mode configuration for enabling remote HMR?
- A roadmap item planned for this?
- Any architectural limitation preventing this behavior?
If not currently supported, I would like to formally request this as a feature enhancement.
Hello Team,
I am using Vite with Module Federation via
vite-plugin-federationin a micro-frontend architecture (origin-based federation).Current Setup
Producer App (Remote)
remoteEntry.jsonly duringvite build.vite buildbefore the host can consume it.vite preview.Consumer App (Host)
pnpm dev.remoteEntry.jsfrom the producer.Problem
In development mode:
The producer app does not support HMR for exposed modules.
Any change in the producer requires:
vite buildvite previewThe consumer app must then re-fetch the updated
remoteEntry.js.This leads to:
Multiple terminals:
build+previewdevFrequent restarts
Slower development workflow
No real-time HMR across federated boundaries
In contrast, the consumer (host) app benefits from Vite’s excellent HMR, but the remote app does not.
Expected Behavior
It would significantly improve developer experience if:
The producer app could run in
devmoderemoteEntry.jscould be dynamically generated in memory (similar to Webpack dev server)HMR updates from producer propagate to consumer without requiring:
Essentially, enabling cross-application HMR in a federated Vite setup.
Why This Matters
In real-world micro-frontend systems:
#Question
Is there:
If not currently supported, I would like to formally request this as a feature enhancement.