Packages

svgo

4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed

Your version

3.1.0

11 Dec 2023Where it was published

3.3.5 is the newest release of 3.x.

In short

6 fixed1 changed

Security

4 advisories affect 3.1.0; 3.3.5 fixes them

Release note

What's Changed

Bug Fixes

  • prefixIds, correctly prefix IDs when <style> tag contains XML comments.

  • removeHiddenElems, improve handling of definitions (<defs>), namely when <defs> are defined at the end of the document.

  • cleanupEnableBackground, clean up inline-styles too.

  • cleanupIds, handle URI encoded references properly.

  • inlineStyles, no longer crashes on non-inlined selectors with a pseudo-class.

  • Improve handling of URL references in reference attributes (url('#a')) across various plugins.

SVG Optimization

  • removeUnknownsAndDefaults, now removes defaults in XML declarations too, enabled by default and can be toggled with defaultMarkupDeclarations.

Metrics

Before and after using vectors from various sources, with the default preset of each respective version:

SVGOriginalv3.0.5v3.1.0Delta
Arch Linux Logo9.529 KiB4.608 KiB4.162 KiB⬇️ 0.446 KiB
Blobs50.45 KiB42.949 KiB42.949 KiB
Isometric Madness869.034 KiB550.153 KiB550.153 KiB
tldr-pages Banner2.071 KiB1.07 KiB1.07 KiB
Wikipedia Logo161.551 KiB117.146 KiB116 KiB⬇️ 1.146 KiB

Before and after of the browser bundle of each respective version:

v3.0.5v3.1.0Delta
svgo.browser.js657.5 kB660.9 kB⬆️ 3.4 kB

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.