Packages

svgo

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

Your version

3.0.4

18 Nov 2023Where it was published

3.3.5 is the newest release of 3.x.

In short

5 fixed4 changed

Security

4 advisories affect 3.0.4; 3.3.5 fixes them

Release note

Includes various bug fixes for existing plugins and a new optimization. Also splits removeXMLNS, which removed XLink, into two separate plugins, removeXMLNS and removeXlink.

What's Changed

Default Behavior

  • removeXMLNS, no longer removes the XLink (xmlns:xlink) namespace. If that is desirable, you should enable the new removeXlink plugin, which does more while being safer.

Bug Fixes

  • convertPathData, ignore instances where transform applied via style tag.

  • inlineStyles, inline properties with the same specificity in the order that they appear in the stylesheet.

  • inlineStyles, don't remove class or id from node if it's traversed in another CSS selector.

  • Don't trim pre elements in foreignObject.

  • Don't crash when encountering @-webkit-keyframes in <style> node.

SVG Optimization

  • convertPathData, convert to z command if going back to initial position, or drop z if redundant.

  • inlineStyles, when inlining a CSS property that's already declared in a presentation attribute of the node, drop the attribute.

  • removeXlink, new plugin that removes the XLink (xmlns:xlink) namespace and migrates from XLink attributes to the SVG 2 equivalent. Disabled by default.

Metrics

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

SVGOriginalv3.0.3v3.0.4Delta
Arch Linux Logo9.529 KiB4.738 KiB4.735 KiB⬇️ 0.003 KiB
Blobs50.45 KiB42.949 KiB42.949 KiB
Isometric Madness869.034 KiB550.699 KiB550.593 KiB⬇️ 0.106 KiB
tldr-pages Banner2.071 KiB1.07 KiB1.07 KiB
Wikipedia Logo161.552 KiB118.441 KiB117.152 KiB⬇️ 1.289 KiB

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

v3.0.3v3.0.4Delta
svgo.browser.js651.7 kB656.9 kB⬆️ 5.2 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.