I’m using Bud.js to hash asset files, including svg. What is the best way to get the contents of an svg file so that it can be inlined via html that is injected via js?
I want the svg compiled with the js file, instead of using a client side fetch to get the manifest file and hashed svg filename for use with .text().
I also want to avoid using <img> or <object> so that external css can modify the svg.
import svg from '@src/images/image.svg' returns the url.
import svg from '@src/images/image.svg?inline' is close but for CSS.
import svg from '@src/images/image.html' works, but I need the extension to remain .svg.
I have a feeling there’s an easy answer for this that’s just eluding me. Perhaps a more manual approach with fs.readFile(), but maybe there’s a better approach with Bud?