Bundles all svg icons from the speciefed folder to the single spritesheet svg file
npm install rollup-plugin-svg-iconsBundles all svg icons from the specified folder to the single spritesheet svg file.
  
``bash`
npm i -D rollup-plugin-svg-icons
`javascript
/ rollup.config.js /
import svgicons from 'rollup-plugin-svg-icons'
export default {
...
plugins: [
svgicons({
// folder with svg-icons
inputFolder: 'src/icons', // it is default value
// path for the sprite file
output: 'dist/bundle.svg', // it is default value
// Also you can use any Svgstore options:
// https://github.com/svgstore/svgstore#svgstore-options
//
// cleanDefs
// cleanSymbols
// svgAttrs
// symbolAttrs
// copyAttrs
// renameDefs
// .. and inline option for svgstore.toSting() method
})
...
]
...
}
`
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:
`html
``
Icons with gradients or some types of complex shapes will not be packed in the sprite correctly.