ModuleFederationPlugin makes the build really slow
Describe the bug
I am working on a massive Angular codebase with a custom webpack config. We already have slow builds by default and I am spiking on using Module Federation for incremental builds to improve build performance of our main app. However, I have found that using the ModuleFederationPlugin with just one remote and no shared config already adds so much overhead to the webpack build, that this scenario is infeasible.
| With ModuleFederation | Without ModuleFederation | |
|---|---|---|
| Cold | 37min | 21min |
| Hot | 17min | 8min |
I am using Webpack 5 and Module Federation enhanced v0.22.0
I have disabled split chunks when using Module Federation as that resulted in runtime module resolution errors. But besides that, the only difference is the usage of the ModuleFederationPlugin
Question: Is this expected in a large codebase, or is this likely a misconfiguration?
Reproduction
Used Package Manager
pnpm
System Info
-
Validations
- [x] Read the docs.
- [x] Read the common issues list.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Make sure this is a Module federation issue and not a framework-specific issue.
- [x] The provided reproduction is a minimal reproducible example of the bug.