You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eab49ca
Browse filesBrowse the repository at this point in the historyBrowse files
* fix: scope parsed module sources by asset
`getViewerData()` merged the parsed module map of every asset into a
single flat object, but Webpack module IDs are only unique within a
compilation. Assets produced by separate compilations - a main bundle
and a worker bundle, or a multi-config build - both number their
modules from `0`, so the last parsed asset overwrote the earlier ones
and modules were attributed another asset's parsed source and size.
Store parsed sources per asset name and look them up using only the
current asset's map, so each module reports the source that was
actually parsed out of the asset it belongs to.
Fixes#732
* fix: isolate per-asset parsed source writes
Scoping the parsed module maps by asset was not enough on its own. A
module that belongs to several assets is represented by a single stats
object, and every asset containing it receives that same object. The
module tree keeps a live reference to it and reads `parsedSrc` lazily,
after the per-asset loop has finished, so the asset processed last
decided what all of them displayed. `Module.mergeData()` accumulated
`size` and `parsedSrc` onto those shared objects for the same reason.
Give each asset its own copies of its modules before attributing any
parsed source, so writing a source for one asset can no longer change
what another asset reports.
`test/analyzerUtils.js` asserted on the stats objects it passed in, so
it now asserts on the returned chart data instead, matching parsed size
against the source length and pinning the source itself through its
gzip size.
* test: clarify shared-module fixture and coverage
Replace the hand-written shared-module fixture with output from a documented Webpack 5 build. Include the source and configuration, use purpose-based bundle names, cover the stat-only fallback, and remove the unreachable array fallback.
Scope parsed module sources to the asset they were parsed from, so assets that reuse the same module IDs, or that share a module, no longer report each other's parsed and compressed sizes.
0 commit comments