Open rlebosse opened 7 years ago
Hi,
I had the same need, so I did like this:
var __svg__ = { path: '../icons/*.svg', name: '[hash].icons.svg' };
// console.log(__svg__.filename); - Has the public path of the file, so you can use it for what you want.
// For example:
<svg>
<use xlink:href="<%=__svg__.filename %>#icon-<name>" />
</svg>
Instead of loading asynchronously the generated .svg file, is there a way to retrieve synchronously it's content in a js file in order to insert it in the webpage the way we want to ?
Something like this :
Thanks!