Skip to content

Commit

Permalink
Remove collect-dependencies span as it balloons trace size (vercel#29266
Browse files Browse the repository at this point in the history
)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
timneutkens and kodiakhq[bot] authored Sep 21, 2021
1 parent 800b2be commit 90a3b50
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,24 +230,19 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
// )
// continue
// }
const collectDependencies = (mod: any, span: Span) => {
const childSpan = span.traceChild('collect-dependencies', {
resource: mod.resource,
})
return childSpan.traceFn(() => {
if (!mod || !mod.dependencies) return
const collectDependencies = (mod: any) => {
if (!mod || !mod.dependencies) return

for (const dep of mod.dependencies) {
const depMod = getModuleFromDependency(compilation, dep)
for (const dep of mod.dependencies) {
const depMod = getModuleFromDependency(compilation, dep)

if (depMod?.resource && !depModMap.get(depMod.resource)) {
depModMap.set(depMod.resource, depMod)
collectDependencies(depMod, childSpan)
}
if (depMod?.resource && !depModMap.get(depMod.resource)) {
depModMap.set(depMod.resource, depMod)
collectDependencies(depMod)
}
})
}
}
collectDependencies(entryMod, entrySpan)
collectDependencies(entryMod)

const toTrace: string[] = [entry, ...depModMap.keys()]

Expand Down

0 comments on commit 90a3b50

Please sign in to comment.