Hey @vio,
It would be nice to set initial: true for chunks directly exposed with module federation. WebpackModuleFederation injects a remote entry chunk that is all auto-generated and only loosely related to app code/the exposed module's size. Subsequently, the remote entry chunk is the only chunk stats list as initial and entry.
While tracking the initial size of the auto-generated code is useful, I'd ideally like to know the size of chunks loaded right after the auto-generated remote entry.
- One approach would be to support
exposes and sharedModules in stats.json.
- Or a general approach capturing and filtering reports by module depth.
I'm a fan of the second approach, where we'd track depth in a build-agnostic way. Depth is also an interesting facet for synchronous and async modules outside of module federation.
To help narrow in on exacts, I created an example test case highlighting a common async app scenario that I'd expect to report initial bundle stats for. The example test and approach 2) don't touch on shared modules, another aspect of module federation currently triggering duplicate dependency reports, requiring stats: { excludeModules: Object.keys(shared) } to suppress.
Hey @vio,
It would be nice to set
initial: truefor chunks directly exposed with module federation. WebpackModuleFederation injects a remote entry chunk that is all auto-generated and only loosely related to app code/the exposed module's size. Subsequently, the remote entry chunk is the only chunk stats list asinitialandentry.While tracking the initial size of the auto-generated code is useful, I'd ideally like to know the size of chunks loaded right after the auto-generated remote entry.
exposesandsharedModulesin stats.json.I'm a fan of the second approach, where we'd track depth in a build-agnostic way. Depth is also an interesting facet for synchronous and async modules outside of module federation.
To help narrow in on exacts, I created an example test case highlighting a common async app scenario that I'd expect to report initial bundle stats for. The example test and approach 2) don't touch on shared modules, another aspect of module federation currently triggering duplicate dependency reports, requiring
stats: { excludeModules: Object.keys(shared) }to suppress.