web-resource-inliner
web-resource-inliner copied to clipboard
Images in `srcset` should be included too
Expected:
Image with both src
and srcset
has both images included
<img src="/images/logo.png" srcset="/images/[email protected] 2x" />
Actual:
Image only has src
included as data URI. srcset
is left unchanged
@jrit in addition to the above, favicons and fonts are also not embedded; do you plan to do this or welcome a PR for this? should there be config to enable/disable types of assets?
@tommedema I'd welcome a PR, but don't plan to add that myself. My preference would be a config similar to how the existing configs work per asset type, and with a similar rationale for defaults.
@jrit if I ever get to this in the future, do you think that the current logic should be refactored to have a single detection and replacement engine in which differences for each type can be injected?
Currently the code is not very DRY, which is already apparent from a glance at the code:

This could be rewritten to 1 block of logic and 4 configuration entries. Wdyt?