Skip to content

Commit

Permalink
perf: replace fromEntries with a for loop (#14041)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Aug 9, 2023
1 parent 490dad8 commit 8b174fd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/optimizer/index.ts
Expand Up @@ -897,9 +897,11 @@ export function newDepOptimizationProcessing(): DepOptimizationProcessing {
export function depsFromOptimizedDepInfo(
depsInfo: Record<string, OptimizedDepInfo>,
): Record<string, string> {
return Object.fromEntries(
Object.entries(depsInfo).map((d) => [d[0], d[1].src!]),
)
const obj: Record<string, string> = {}
for (const key in depsInfo) {
obj[key] = depsInfo[key].src!
}
return obj
}

export function getOptimizedDepPath(
Expand Down

0 comments on commit 8b174fd

Please sign in to comment.