This release allows for avoiding over-sharing (usually caused by shareAll
) by scanning the code for npm packages that are actually used. This brings several benefits:
- Improved build times
- Improved start-up times (smaller import map)
- Fewer issues with node packages that are in the (mono) repo but not used by the app in question
- Prevents subtle bugs such as #865
Start-up times are especially improved when using packages with many secondary entry points, such as date-fns
. Before, each of these entry points was built and added to the source map; now, only the ones actually needed are added.
This feature is hidden behind a feature flag to allow for a backwards-compatible behavior.
Activate it in your federation.config.js
as follows:
features: {
ignoreUnusedDeps: true
}
Full Changelog: 20.0.2...20.0.3