Skip to content

Commit

Permalink
refactor: use isDataUrl instead of startsWith("data:") (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson authored Jan 7, 2021
1 parent fa3bc34 commit 28fe201
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,7 @@ function rewriteCssUrls(
wrap = first
rawUrl = rawUrl.slice(1, -1)
}
if (
isExternalUrl(rawUrl) ||
rawUrl.startsWith('data:') ||
rawUrl.startsWith('#')
) {
if (isExternalUrl(rawUrl) || isDataUrl(rawUrl) || rawUrl.startsWith('#')) {
return matched
}
return `url(${wrap}${await replacer(rawUrl)}${wrap})`
Expand Down

0 comments on commit 28fe201

Please sign in to comment.