A Webpack 4 plugin that implements module federation, allowing multiple separately built applications to share code and dependencies at runtime. This is an early beta (v1.0.0-beta-1) of the official ModuleFederationPlugin backported for Webpack 4, with similar API to the Webpack 5 version. It enables micro-frontends by exposing and consuming remote modules via a dynamic import pattern. Unlike the Webpack 5 built-in, this requires explicit configuration of libraryTarget 'global' and manual addition of remoteEntry.js scripts to HTML. The library is considered experimental, not recommended for production, and lacks the maturity and features of the official Webpack 5 ModuleFederationPlugin.
npm install webpack-plugin-module-federationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Webpack 4 configuration to expose a remote entry point for module federation. Requires setting libraryTarget to 'global' and manually including remoteEntry.js script in host HTML.
Consider using Webpack 5 with built-in ModuleFederationPlugin for stable API.
Use: const MFPlugin = require('webpack-plugin-module-federation'); new MFPlugin({...})Set output.publicPath appropriately and add script tag referencing the remoteEntry.js file.
Ensure expose keys match exactly and the remote container is loaded before dynamic import.
Migrate to Webpack 5 and use its built-in ModuleFederationPlugin.
Use: const MFPlugin = require('webpack-plugin-module-federation'); new MFPlugin({...});Run: npm install --save-dev webpack-plugin-module-federation
Use require instead: const MFPlugin = require('webpack-plugin-module-federation');Set libraryTarget: 'global' in ModuleFederationPlugin options.