Closed FloEdelmann closed 1 year ago
Thanks for fix. Why you don't use svg-sprite-module from nuxt-comunity? It's more optimized and fast. It's the same as my planned second version 😂
I've looked at that module, but since the sprite is not embedded into the page directly, it's another HTTP request that can easily be avoided. Is there any chance this repository in it's current form will continue to be supported?
May be not. I will PR to their module. Because all my planned features are there :)
First PR will be inlineing to html
But we may to wait some time, because I'm hard woking now
Nuxt.js allows users to have all Nuxt files in a subdirectory with the
srcDir
option. When this option is set, nuxt-svgicon build fails.Example
nuxt.config.js:
Generating the icon components in the correct location works. However, the build fails because it can't resolve the module
~/ui/assets/icons/bundle
(because~
already resolves toui
). I tracked the failing import down to svgicon.template.js.With the fix from this PR, that template now only receives the distPath
assets/icons/bundle
, so it can safely prepend~/
.