nuxt-modules / svg-sprite

Optimize SVG files and combine them into sprite
https://codesandbox.io/s/github/nuxt-community/svg-sprite-module/
MIT License
295 stars 41 forks source link

Include `icons.svg` inline #304

Open ghost opened 9 months ago

ghost commented 9 months ago

I see that all the icons are added to the following file: "_nuxt/assets/sprite/gen/icons.svg".

Is there a way we can directly add the contents of the file to the body and not access it via a URL?

I am trying to load the icon in the below manner and was wondering if this was possible:

h('use', {
    attrs: {
        'xlink:href': `#${iconID}`,
    },
})

Also, thank you for all your hard work.