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

Function rewriteImportCss

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

Source from the content-addressed store, hash-verified

2102}
2103
2104function rewriteImportCss(
2105 css: string,
2106 replacer: CssUrlReplacer,
2107): Promise<string> {
2108 return asyncReplace(css, importCssRE, async (match) => {
2109 const [matched, rawUrl] = match
2110 return await doImportCSSReplace(rawUrl, matched, replacer)
2111 })
2112}
2113
2114// TODO: image and cross-fade could contain a "url" that needs to be processed
2115// https://drafts.csswg.org/css-images-4/#image-notation

Callers 1

rebaseUrlsFunction · 0.85

Calls 2

asyncReplaceFunction · 0.90
doImportCSSReplaceFunction · 0.85

Tested by

no test coverage detected