Module federation is a webpack 5 features. It allows independent deployments for you different applications. Same as HTML import map? Yes but it allows more flexible configuration and reuse not only JavaScript files.
What Module federation can do?
- Can share individual JS modules together with it's dependencies. You can share a react component together with styles and static data.
- Can share any module, that webpack supports.
- Can share the whole application as a micro-front-end
- Must share a common libraries like react, react-dom and/or components library
Use cases
- Independent applications deployment
- Independent pages deployment (aka mfe)
- Independent components deployment. To share components library for other "containers" to use.