Skip to content

Commit

Permalink
fix(css): unknown file error happened with lightningcss (#16306)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Mar 29, 2024
1 parent eca68fa commit 01af308
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2754,12 +2754,13 @@ async function compileLightningCSS(
switch (dep.type) {
case 'url':
if (skipUrlReplacer(dep.url)) {
css = css.replace(dep.placeholder, dep.url)
css = css.replace(dep.placeholder, () => dep.url)
break
}
deps.add(dep.url)
if (urlReplacer) {
css = css.replace(dep.placeholder, await urlReplacer(dep.url, id))
const replaceUrl = await urlReplacer(dep.url, id)
css = css.replace(dep.placeholder, () => replaceUrl)
}
break
default:
Expand Down

0 comments on commit 01af308

Please sign in to comment.