I am working on converting some existing Angular components into web components using Angular Elements, so they can be embedded onto another site.
One issue I have run into is how to include images (or other assets) in the web component bundle. E.g. if I have a component which uses an icon like:
<img class="my-icon" src="/assets/icons/my-icon.png" />
The standard answers suggest using inline data URIs (example) which seems sensible to me.
Has anyone got any idea whether there are any existing tools for making this kind of substitution at 'ng build' time? Ideally would read the file path -> convert to data URL -> replace the above src with the data URL. I have found some webpack projects like 'base64-inline-loader' but they seem more focussed on applying this change in the CSS rather than in the HTML/ elsewhere.