Skip to content

Commit

Permalink
perf: pass finalizeOtherSpecifiers when only needed
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 25, 2024
1 parent 1d8282b commit e43e05b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,17 @@ export function oxcResolvePlugin(
}
return newId
},
finalizeOtherSpecifiers(resolvedId, rawId) {
return ensureVersionQuery(resolvedId, rawId, options, depsOptimizer)
},
finalizeOtherSpecifiers: !depsOptimizer
? undefined
: (resolvedId, rawId) => {
const newResolvedId = ensureVersionQuery(
resolvedId,
rawId,
options,
depsOptimizer,
)
return newResolvedId === resolvedId ? undefined : newResolvedId
},
}) as unknown as Plugin
},
),
Expand Down

0 comments on commit e43e05b

Please sign in to comment.