Module Federation

It was through a sharing session within my organisation that I learned about Module Federation as one of the most exciting feature in Webpack 5. According to different blogs, they claimed that this is a game changer in JavaScript.

What is Module Federation?

Based on the definition, it is a webpack module that makes sharing code and dependencies between different code bases easier. This loads the code dynamically at runtime to reduce code duplication and only downloads the missing dependencies if any.

Possible uses

Component library

As part of the sharing session, it was being introduced with the component library build for the organisation. This is important and useful so that there is a single design language which enforces the brand and UX guidelines across all the other projects.


They are not exactly components but main purpose is basically to scale applications that are in large organisations.

Personal thoughts

This is a very new concept to me and is something I definitely look forward to utilise. At this moment, I will choose to use it for projects that requires scalability and huge amount of code sharing among independent applications.

That is all I have for today and really excited to see where Module Federation brings JavaScript to.