Migrating a Webpack-Era Federated Module to Vite Without Breaking the Host Contract
A practical guide to migrating a federated remote to Vite, based on lessons from a real migration. I was tasked with updating a legacy React application that did not support Module Federation. That...

Source: DEV Community
A practical guide to migrating a federated remote to Vite, based on lessons from a real migration. I was tasked with updating a legacy React application that did not support Module Federation. That integration was added first so the app could run as a remote inside a larger host application. Later, the remote needed to migrate from Create React App (CRA) to Vite. By that point, the host already depended on the remote's loading behavior. The tricky part was not replacing CRA with Vite. It was preserving the runtime contract while only the remote changed bundlers. If you own a CRA or webpack-era remote that still has to load cleanly inside an existing host, this post covers the cleanup work beforehand, the core CRA-to-Vite swap, the federation-specific deployment fixes, and a local dev harness for debugging the full host loading sequence without redeploying every change. Terms for reference CRA: Create React App. For years it was the default easy on-ramp for React apps before being depre