Unverified Commit b998bd8e authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

bundle-analyzer: restore traced-dependents logic dropped by buildImportChain extraction

Co-authored-by: 's avatarWill Binns-Smith <wbinnssmith@gmail.com>
Co-authored-by: 's avatarWill Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
parent be14c4d5
...@@ -219,6 +219,7 @@ export function buildImportChain( ...@@ -219,6 +219,7 @@ export function buildImportChain(
.map((index: number) => ({ .map((index: number) => ({
index, index,
async: false, async: false,
traced: false,
depth: depthMap.get(index) ?? Infinity, depth: depthMap.get(index) ?? Infinity,
})), })),
...modulesData ...modulesData
...@@ -226,6 +227,15 @@ export function buildImportChain( ...@@ -226,6 +227,15 @@ export function buildImportChain(
.map((index: number) => ({ .map((index: number) => ({
index, index,
async: true, async: true,
traced: false,
depth: depthMap.get(index) ?? Infinity,
})),
...modulesData
.tracedModuleDependents(currentModuleIndex)
.map((index: number) => ({
index,
async: false,
traced: true,
depth: depthMap.get(index) ?? Infinity, depth: depthMap.get(index) ?? Infinity,
})), })),
] ]
...@@ -242,7 +252,7 @@ export function buildImportChain( ...@@ -242,7 +252,7 @@ export function buildImportChain(
// Build info for each dependent // Build info for each dependent
const dependentsInfo: DependentInfo[] = validDependents.map( const dependentsInfo: DependentInfo[] = validDependents.map(
({ index: moduleIndex, async: isAsync, depth }) => { ({ index: moduleIndex, async: isAsync, traced: isTraced, depth }) => {
const sourceIndex = getSourceIndexFromModuleIndex(moduleIndex) const sourceIndex = getSourceIndexFromModuleIndex(moduleIndex)
let ident = modulesData.module(moduleIndex)?.ident || '' let ident = modulesData.module(moduleIndex)?.ident || ''
return { return {
...@@ -250,6 +260,7 @@ export function buildImportChain( ...@@ -250,6 +260,7 @@ export function buildImportChain(
sourceIndex, sourceIndex,
ident, ident,
isAsync, isAsync,
isTraced,
depth, depth,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment