MCPcopy
hub / github.com/vitejs/vite / rewriteCssUrls

Function rewriteCssUrls

packages/vite/src/node/plugins/css.ts:2087–2095  ·  view source on GitHub ↗
(
  css: string,
  replacer: CssUrlReplacer,
)

Source from the content-addressed store, hash-verified

2085UrlRewritePostcssPlugin.postcss = true
2086
2087function rewriteCssUrls(
2088 css: string,
2089 replacer: CssUrlReplacer,
2090): Promise<string> {
2091 return asyncReplace(css, cssUrlRE, async (match) => {
2092 const [matched, rawUrl] = match
2093 return await doUrlReplace(rawUrl.trim(), matched, replacer)
2094 })
2095}
2096
2097function rewriteCssDataUris(
2098 css: string,

Callers 3

OnceFunction · 0.85
rewriteCssImageSetFunction · 0.85
rebaseUrlsFunction · 0.85

Calls 2

asyncReplaceFunction · 0.90
doUrlReplaceFunction · 0.85

Tested by

no test coverage detected