Skip to content

Commit

Permalink
Update reasons array to use module id instead of identifier (#21895)
Browse files Browse the repository at this point in the history
Missed this then changing the modules array to rely on `module.id`
  • Loading branch information
timneutkens committed Feb 5, 2021
1 parent ee184a1 commit 6387f36
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/next/build/webpack/plugins/build-stats-plugin.ts
Expand Up @@ -18,20 +18,20 @@ function reduceSize(stats: any) {
}

for (const module of chunk.modules) {
if (!module.identifier) {
if (!module.name) {
continue
}

const reducedModule: any = {
type: module.type,
moduleType: module.moduleType,
size: module.size,
identifier: module.identifier,
name: module.name,
}

if (module.reasons) {
for (const reason of module.reasons) {
if (!reason.moduleIdentifier) {
if (!reason.name) {
continue
}

Expand All @@ -40,11 +40,11 @@ function reduceSize(stats: any) {
}

reducedModule.reasons.push({
moduleIdentifier: reason.moduleIdentifier,
id: reason.id,
})
}
}
// Identifier is part of the Map

modules.set(module.id, reducedModule)

if (!reducedChunk.modules) {
Expand Down

0 comments on commit 6387f36

Please sign in to comment.