Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Svgo | 19,020 | 281,763 | 2,549 | 6 days ago | 92 | November 02, 2021 | 274 | mit | JavaScript | |
⚙️ Node.js tool for optimizing SVG files | ||||||||||
Imagemin Webpack Plugin | 668 | 1,163 | 301 | 2 years ago | 40 | July 29, 2019 | 20 | mit | JavaScript | |
Plugin to compress images with imagemin | ||||||||||
Babel Plugin Inline React Svg | 466 | 598 | 567 | a month ago | 18 | February 23, 2021 | 32 | mit | JavaScript | |
A babel plugin that optimizes and inlines SVGs for your React Components. | ||||||||||
Grunt Svgmin | 436 | 35,074 | 325 | 2 months ago | 19 | July 31, 2020 | mit | JavaScript | ||
Minify SVG | ||||||||||
Webpack Svgstore Plugin | 204 | 110 | 51 | 2 years ago | 47 | October 15, 2018 | 27 | JavaScript | ||
Simple svg-sprite creating with webpack | ||||||||||
Grunt Svg2png | 77 | 239 | 17 | 4 years ago | 12 | September 19, 2017 | 31 | mit | JavaScript | |
Grunt plugin to rasterize SVG to PNG images using PhantomJS | ||||||||||
Vue Cli Plugin Svg Sprite | 70 | 11 | 9 | 5 months ago | 6 | April 15, 2021 | 2 | mit | JavaScript | |
vue-cli 3 plugin to build an SVG sprite | ||||||||||
Html Webpack Inline Svg Plugin | 59 | 20 | 17 | a year ago | 41 | August 12, 2020 | 2 | mit | JavaScript | |
Embed svg inline when using the html webpack plugin | ||||||||||
Inkscape Svgo | 55 | 2 years ago | 12 | September 19, 2021 | Makefile | |||||
Plugin to optimize SVGs in inkscape | ||||||||||
Babel Plugin Inline Svg | 50 | 74 | 114 | a year ago | 5 | September 19, 2020 | 2 | JavaScript | ||
Babel plugin to optimise and inline svg |
rollup-plugin-svgo
A rollup plugin to import svg files processed with svgo
SVG files, especially those exported from various editors, usually contain a lot of redundant and useless information. This can include editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting the SVG rendering result.
npm i -D rollup-plugin-svgo
import svgo from 'rollup-plugin-svgo'
export default {
plugins: [
svgo(/* options */)
]
}
If you want to skip any svgo processing you can pass
{
raw: true
}
in options. This will import the svg content as is.
Other options are passed directly to svgo to toggle various svgo plugins. You can find all plugins here: svg/svgo
Svgo options are a bit verbose to write, so see the defaults used below for how to do it:
{
plugins: [{
removeViewBox: false
}, {
removeDimensions: true
}]
}