-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svg-sprites does not contain sprite files #620
Comments
Hi @davidtong and @leddie24, I'm the author of
The per-icon sprites are effective for projects that want to use a CDN like JSDelivr with minimal config to achieve reasonable caching and avoid listing this package as a dependency, the caveat being the UA needs to make lot of requests and usually the app needs to proxy those requests.
If you want to bundle multiple icons into the same sprite, you just need to modify the The CLI documentation for e.g. |
It looks like paths didn't resolve correctly when you ran this — Make sure when you run this package’s scripts, paths resolve relative to this package’s root. |
Thanks, @thure. I will look into the pointers you provided. For now, my project will likely use individual React components that we selectively import, but we will revisit the SVG approach in the future. |
Hello, first of all, thanks for the great work.
I would like to consume SVG icons in a sprite such that I don't get the entire collection of react-icons loaded into my application. I looked at #328 by @thure and @tomi-msft , and I do not understand why all the icons are made into one sprite PER icon. There are 14K sprites in the output. This defeats the purpose of creating sprites as they aren't much different than individual icons.
The example from @fluentui/svg-sprites/README.md also doesn't seem to use any real sprite:
The assetId is unique per icon/size/variant. That's again not different than using individual icons.
Any tips on how I should proceed with using sprites for icons in my project?
Thanks!
The text was updated successfully, but these errors were encountered: