vite-plugin-icons-spritesheet
vite-plugin-icons-spritesheet copied to clipboard
add svgo
Fixes #7
Description
Add SVGO for svg optimizations.
Type of change
Please mark relevant options with an x in the brackets.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update
- [ ] Algorithm update - updates algorithm documentation/questions/answers etc.
- [ ] Other (please describe):
How Has This Been Tested?
Tested against the remix-vite test app with basic-shapes.svg and looking at the output.
- [ ] Integration tests
- [ ] Unit tests
- [x] Manual tests
- [ ] No tests required
Reviewer checklist
Mark everything that needs to be checked before merging the PR.
- [x] Check if the UI is working as expected and is satisfactory
- [x] Check if the code is well documented
- [x] Check if the behavior is what is expected
- [x] Check if the code is well tested
- [x] Check if the code is readable and well formatted
- [ ] Additional checks (document below if any)
Screenshots (if appropriate):
Questions (if appropriate):
However, I don't know how much you'd be gaining from SVGO in this situation, published icons are probably already optimized. Although many are exported from Figma, so those aren't optimized, for them it might be good to optimize.
Also, here you're running SVGO for each icon, and for performance SVGO might be best run once per entire SVG sprite (with special care for default options like cleanupIds), but that seems like a job better suited for vite-plugin-svgo for people to do it at their own risk. I don't know whether it's worth it to include SVGO as a dependency of this plugin.
Anyway, that's all from me.