rollup-plugin-svg-icons
Bundles all svg icons from the specified folder to the single spritesheet svg file.
Installation
npm i -D rollup-plugin-svg-icons
Rollup configuration
/* rollup.config.js */ ... plugins: ... ...
Usage in HTML
Use href bundle.svg#iconid
where iconid
is base part of svg-icon filename. For ex. if in source folder you have myicon.svg
then you should use bandle.svg#myicon
:
Restrictions
Icons with gradients or some types of complex shapes will not be packed in the sprite correctly.
Inspiration
Plugin based on svgstore package.
License
MIT