postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 60 forks source link

Filter not matching remote https url #172

Open sayowayah opened 2 years ago

sayowayah commented 2 years ago

Hello, my custom rules are working fine when matching relative urls or absolute urls that begin with "/". However, I can't seem to match a full remote absolute url (i.e. including the https://).

For example, filter: /bar.jpg$/ will match url("/foo/bar.jpg") but it will skip url("https://test.com/foo/bar.jpg") (I've tried adding .* at the front of the regex as well to no avail).

Just wondering if I'm missing a setting somewhere or if the library simply doesn't support this use case? The reason I'm trying to do this is to dynamically switch my cdn image links to a backup domain in emergencies.