Utilizing Module Federation
Module Federation has been introduced as an integrated plugin for the webpack bundler. While Module Federation can be thought of as a mental model for micro frontends or dependency sharing, it is also, most importantly, a technical implementation and tooling to support micro frontends.
Classically, Module Federation has been part of the webpack bundler, starting from version 5. As of today, there are other bundlers such as rspack that support Module Federation. While rspack is still very close to webpack, the whole approach has been ported to API-incompatible bundlers too. Most notably, there is a community contribution that brings some of the features of Module Federation to the Vite bundler.
To get started with Module Federation, we need to use a supporting bundler. For example, let’s say that we’ll stay at the original implementation using webpack. To actually use webpack, we must create a valid webpack configuration, which lives in...