Configuring Shared Dependencies
Learn how the shared option in Module Federation lets host and remote apps share libraries like React, avoiding duplicate downloads and version conflicts.
The Duplication Problem
Without coordination, a host and each remote would each bundle their own copy of React, Lodash, and other libraries. Users would download the same code many times.
The shared option solves this.
What shared Does
The shared key in ModuleFederationPlugin tells webpack which dependencies should be loaded once and reused across federated apps at run time.
All lessons in this course
- Webpack Fundamentals Review
- Introducing Module Federation
- Host and Remote Applications
- Configuring Shared Dependencies