astroturf icon indicating copy to clipboard operation
astroturf copied to clipboard

Statically analyzable base64 strings

Open ivancuric opened this issue 5 years ago • 1 comments

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?

ivancuric avatar Apr 15 '19 11:04 ivancuric

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.

taion avatar Apr 15 '19 14:04 taion