Skip to content

Commit 73e971f

Browse files
authored
perf: remove debug only prettifyUrl call (#15204)
1 parent d8001c5 commit 73e971f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/vite/src/node/plugins/importAnalysis.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,9 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
218218
}
219219

220220
const ssr = options?.ssr === true
221-
const prettyImporter = prettifyUrl(importer, root)
222221

223222
if (canSkipImportAnalysis(importer)) {
224-
debug?.(colors.dim(`[skipped] ${prettyImporter}`))
223+
debug?.(colors.dim(`[skipped] ${prettifyUrl(importer, root)}`))
225224
return null
226225
}
227226

@@ -258,7 +257,9 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
258257
if (!imports.length && !(this as any)._addedImports) {
259258
importerModule.isSelfAccepting = false
260259
debug?.(
261-
`${timeFrom(start)} ${colors.dim(`[no imports] ${prettyImporter}`)}`,
260+
`${timeFrom(start)} ${colors.dim(
261+
`[no imports] ${prettifyUrl(importer, root)}`,
262+
)}`,
262263
)
263264
return source
264265
}
@@ -702,7 +703,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
702703
: acceptedUrls.size
703704
? `[accepts-deps]`
704705
: `[detected api usage]`
705-
} ${prettyImporter}`,
706+
} ${prettifyUrl(importer, root)}`,
706707
)
707708
// inject hot context
708709
str().prepend(
@@ -784,7 +785,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
784785

785786
debug?.(
786787
`${timeFrom(start)} ${colors.dim(
787-
`[${importedUrls.size} imports rewritten] ${prettyImporter}`,
788+
`[${importedUrls.size} imports rewritten] ${prettifyUrl(
789+
importer,
790+
root,
791+
)}`,
788792
)}`,
789793
)
790794

0 commit comments

Comments
 (0)