Skip to content

Commit f1a2635

Browse files
Copilotsapphi-red
andauthored
fix(css): avoid warnings for image-set containing __VITE_ASSET__ (vitejs#20520)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: sapphi-red <[email protected]>
1 parent 6a46cda commit f1a2635

File tree

1 file changed

+4
-1
lines changed
  • packages/vite/src/node/plugins

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,10 @@ function skipUrlReplacer(unquotedUrl: string) {
20212021
isExternalUrl(unquotedUrl) ||
20222022
isDataUrl(unquotedUrl) ||
20232023
unquotedUrl[0] === '#' ||
2024-
functionCallRE.test(unquotedUrl)
2024+
functionCallRE.test(unquotedUrl) ||
2025+
// skip if it is already a placeholder
2026+
unquotedUrl.startsWith('__VITE_ASSET__') ||
2027+
unquotedUrl.startsWith('__VITE_PUBLIC_ASSET__')
20252028
)
20262029
}
20272030
async function doUrlReplace(

0 commit comments

Comments
 (0)