Summary
Webpack/Vite federation — runtime share of remote modules across apps (remoteEntry.js). Shared dependency versioning (singleton React) critical. Enables independent deploy; adds network/runtime coupling. Fallback when remote down — error boundaries and cached builds.
Code example
// Host app webpack.config.js concept
/*
new ModuleFederationPlugin({
name: 'shell',
remotes: { shop: 'shop@https://cdn.example.com/remoteEntry.js' },
shared: { react: { singleton: true, requiredVersion: '^18.0.0' } },
});
*/
const Shop = React.lazy(() => import('shop/ProductPage'));
Key points
- Webpack/Vite federation — runtime share of remote modules across apps (
remoteEntry.js). - Shared dependency versioning (singleton React) critical.
- Enables independent deploy; adds network/runtime coupling.
- Fallback when remote down — error boundaries and cached builds.