astroturf
astroturf copied to clipboard
Statically analyzable base64 strings
On a previous project I used https://github.com/TrySound/postcss-inline-svg to inline SVGs. It would make sense (IMO) for the following to work:
import dropdownIcon from 'url-loader!./assets/icons/dropdown.svg';
css`
.dropdown {
background-image: url(${dropdownIcon});
}
`
Is there any way to make it work? Or have I gotten the definition of "statically analyzable" completely wrong?
I'm not sure how clever the static analysis here is. I suppose it might be possible if we could get webpack to statically transform that import, but I'm not familiar enough with how this stuff works in webpack.