Skip to content

Commit

Permalink
chore(optimizer): show full optimized deps list (#12686)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Apr 5, 2023
1 parent 89e4977 commit 8bef662
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,18 +437,7 @@ export function toDiscoveredDependencies(
}

export function depsLogString(qualifiedIds: string[]): string {
if (debug) {
return colors.yellow(qualifiedIds.join(`, `))
} else {
const total = qualifiedIds.length
const maxListed = 5
const listed = Math.min(total, maxListed)
const extra = Math.max(0, total - maxListed)
return colors.yellow(
qualifiedIds.slice(0, listed).join(`, `) +
(extra > 0 ? `, ...and ${extra} more` : ``),
)
}
return colors.yellow(qualifiedIds.join(`, `))
}

/**
Expand Down

0 comments on commit 8bef662

Please sign in to comment.