Packages

svgo

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

Your version

2.3.0

28 Mar 2021Where it was published

2.8.4 is the newest release of 2.x.

In short

1 fixed8 changed

Security

4 advisories affect 2.3.0; 2.8.4 fixes them

Release note

Hey, everybody! We have a big release here.

  • The new plugin is added for merging style elements into one. See #1381

Before:

<svg>
  <style media="print">
    .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
  </style>
  <style>
    .test { background: red; }
  </style>
</svg>

After:

<svg>
  <style>
    @media print{
      .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
    }
    .test { background: red; }
  </style>
</svg>
  • CLI got new --exclude flag which uses regexps to exclude some files from --folder. See #1409

svgo --folder=svgs --exclude "invalid-icon" "bad-.+"
  • Internal AST is migrated to XAST. This spec makes maintaining plugins easier and may be used as interop with other tools like SVGR.

  • The new visitor plugin type combines features of "full", "perItem" and "perItemReverse" plugins without loosing simplicity. Eventually only visitor api will be supported. See #1454

Also small fixes

  • Override default floatPrecision in plugins with globally specified one (7389bcd)

  • Fix rendering -0 in path data (3d4adb6)

  • Make browser bundle 30% smaller (2799622)

  • Simplified convertPathData plugin (a04b27a and 6165743)

  • Prepared for more regression tests (d89d36e)

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.