Update dependency svgo to v3
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
svgo | devDependencies | major | ^1.3.0 -> ^3.0.2 |
MR created with the help of gitlab-org/frontend/renovate-gitlab-bot
Release Notes
svg/svgo
v3.0.2
Installing @types/csso
no longer required
v3.0.1
- store exposed types only in .d.ts files, no longer need to enable js checking
- update svgo.browser.js
- fixed "begin" attribute cleanup
Thanks to @Kreeg, @XhmikosR and @TrySound
v3.0.0
SVGO v3
Improvements and fixes
- fixed
datauri
option whenmultipass
is not enabled - improved default preset warnings
Breaking channges
- Node.js 14+ is required for version
- stable package is replaced with native stable sort (required node 12+)
Config
Typescript types are exposed out of the box. No longer need to install @types/svgo
// svgo.config.js
/**
* @​type {import('svgo').Config}
*/
export default {
// svgo configuration
}
Active flag is no longer supported
export default {
plugins: [
{
name: 'removeDoctype',
active: true
},
{
name: 'removeComments',
active: false
}
]
}
extendDefaultPlugins
is removed, preset-default
plugin should be used instead
when need to customize plugins defaults
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// plugins customization
}
}
}
]
}
Enabled sortAttrs plugin by default to get better gzip compression.
<svg>
- <rect fill-opacity="" stroke="" fill="" stroke-opacity="" />
+ <rect fill="" fill-opacity="" stroke="" stroke-opacity="" />
</svg>
Can be disabled if necessary
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
sortAttrs: false
}
}
}
]
}
cleanupIDs plugin is renamed to cleanupIds
export default {
plugins: [
'cleanupIds'
]
}
// or
export default {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
cleanupIds: {}
}
}
}
]
}
Removed cleanupIds plugin "prefix" param, prefixIds should be used instead
export default {
plugins: [
'cleanupIds',
{
name: 'prefixIds',
params: {
prefix: 'my-prefix'
}
}
]
}
Public API
Removed width and height from optimization result.
const { width, height } = optimize(svg).info
Can be found with custom plugin
let width = null
let height = null
const plugin = {
name: 'find-size',
fn: () => {
return {
element: {
enter: (node, parentNode) => {
if (parentNode.type === 'root') {
width = node.attributes.width
height = node.attributes.height
}
}
}
}
}
}
optimize(svg, {
plugins: ['preset-default', plugin]
})
Removed error and modernError from optimization result
const {data, error, modernError } = optimize(svg)
Now all errors are thrown, parsing error can be checked by name
try {
const { data } = optimize(svg)
} catch (error) {
if (error.name === 'SvgoParserError') {
// formatted error
error.toString()
} else {
// runtime error
}
}
Custom plugins
Removed full
, perItem
and perItemReverse
plugin types.
visitor
is the only supported plugin api so plugin.type
is no longer required.
Removed plugin.active
flag.
Removed plugin.params
used as default params, destructuring with defaults can be used instead
name
and fn
are only required now
const plugin = {
name: 'my-custom-plugin',
fn: (root, params) => {
const { myParam = true } = params
return {}
}
}
Removed createContentItem
and JSAPI class from nodes.
All nodes are now plain objects with one exception.
parentNode need to be defined to not break builtin plugins.
const plugin = {
name: 'my-custom-plugin',
fn: () => {
return {
element: {
enter: (node) => {
if (node === 'g') {
const child = {
type: 'element',
name: 'g',
attributes: {},
children: []
}
Object.defineProperty(child, 'parentNode', {
writable: true,
value: node,
})
node.children.push(child)
}
}
}
}
}
}
Thanks to @istarkov, @boidolr, @deining, @ranman, @mondeja, @liamcmitchell-sc, @rogierslag, @kriskowal, @hugolpz and @TrySound
v2.8.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
Join us in our discord
Features and bug fixes
- added --no-color flag for testing purposes but you may find it useful (https://github.com/svg/svgo/pull/1588)
- handle url() in style attributes properly (https://github.com/svg/svgo/pull/1592)
- removeXMLNS plugin now removes
xmlns:xlink
attribute (https://github.com/svg/svgo/pull/1508) - load .cjs configuration only with
require
to fix segfaults in linux (https://github.com/svg/svgo/pull/1605)
Refactorings
- simplified and covered with types svg stringifier (https://github.com/svg/svgo/pull/1593)
- migrated to visitor api and covered with types removeEmptyAttrs plugin (https://github.com/svg/svgo/pull/1594)
- migrated to visitor api and covered with types inlineStyles plugin (https://github.com/svg/svgo/pull/1601)
- migrated to picocolors (https://github.com/svg/svgo/pull/1606)
DX
I found some users are trying to enable plugins which are not part of default preset, for example
{
name: 'preset-default',
params: {
overrides: {
cleanupListOfValues: true
}
}
}
To fix this I made docs more concrete about plugin (https://github.com/svg/svgo/commit/5165ccb9d1f116b26a30a020e65aadd666012cb1) and introduced a warning when true is specified in overrides (https://github.com/svg/svgo/commit/cb7e9be623b6e2fbbfcb9b67c4c85131e1477925). Please give us feedback if you still have issues.
Thanks to @IlyaSkriblovsky, @devongovett, @matheus1lva, @omgovich, @renatorib and @TrySound
v2.7.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
Join us in our discord
ES Modules support
This release adds support for es modules in svgo.config.js when package.json type field is "module". For projects with mixed cjs and esm svgo.config.mjs and svgo.config.cjs are also supported as fallback.
See https://github.com/svg/svgo/pull/1583
export default {
plugins: [
'preset-default'
]
}
Fixes
- added validation to removeAttrs plugin (https://github.com/svg/svgo/pull/1582)
Refactorings
Follwing plugins are migrated to the new visitor plugin api and covered with tsdoc
- collapseGroups (https://github.com/svg/svgo/pull/1572)
- mergeStyles (https://github.com/svg/svgo/pull/1575)
- moveElemsAttrsToGroup (https://github.com/svg/svgo/pull/1574)
Other internal changes
- covered svg parser with tsdoc (https://github.com/svg/svgo/pull/1584)
- avoided parentNode in style manager which makes us one step closer to releasing new plugin api publicly (https://github.com/svg/svgo/pull/1576)
- replaced colorette with nanocolors (https://github.com/svg/svgo/pull/1586)
Thanks to @renatorib, @matheus1lva, @omgovich, @deepsweet, @ai, @samouss and @TrySound
v2.6.1
- fixed
optimize(svg)
usage without config (https://github.com/svg/svgo/pull/1573) - added missing filter primitives to collections (https://github.com/svg/svgo/pull/1571)
- migrated to visitor plugin api and covered with tsdoc removeEmptyContainers plugin (https://github.com/svg/svgo/pull/1570)
Thanks to @XhmikosR, @thewilkybarkid, @renatorib, @matheus1lva, @omgovich and @TrySound
v2.6.0
If you enjoy SVGO and would like to support our work, consider sponsoring us directly via our OpenCollective.
We have some good stuff in this release
https://github.com/svg/svgo/pull/1553)
Better syntax errors (Before people struggled to figure out what and why happens with such cryptic error
Error: Error in parsing SVG: Unquoted attribute value
Line: 1
Column: 29
Char: 6
File: input.svg
This gives too little information when a lot of svgs are transformed.
New errors look like this, include context and point to exact location with the issue. We hope this will solve many issues when dealing with bundlers and other tools integrations.
Error: SvgoParserError: input.svg:2:29: Unquoted attribute value
1 | <svg viewBox="0 0 120 120">
> 2 | <circle fill="#ff0000" cx=60.444444" cy="60" r="50"/>
| ^
3 | </svg>
4 |
https://github.com/svg/svgo/pull/1561)
pefixIds plugin is now idempotent (To get better compression results SVGO uses multipass option. This option is used to run prefixIds plugin only once to prefix ids and classes properly.
Though sometimes users run svgo manually a few times which leads to duplicated prefixes and make code much bigger. To solves this prefixIds was redesigned to add prefix only when it does not exit in ids and classes.
Eventually all plugins are planned to be determenistic and idempotent so multipass option would not be necessary and single pass compression could be as effective as possible.
https://github.com/svg/svgo/pull/1546)
New js2svg options (js2svg.eol: 'lf' | 'crlf'
Allows to customize end of line characters which is usually resolved by os.EOL in node.
finalNewline: boolean
Ensures SVG output has a final newline which is required for some tools like git.
Fixes and refactorings
Follwing plugins are migrated to the new visitor plugin api and covered with tsdoc
- reusePaths (https://github.com/svg/svgo/pull/1551)
- removeUselessStrokeAndFill (https://github.com/svg/svgo/pull/1549)
- minifyStyles (https://github.com/svg/svgo/pull/1552)
- cleanupIDs (https://github.com/svg/svgo/pull/1556)
- removeEditorsNSData (https://github.com/svg/svgo/pull/1557)
- removeUnusedNS (https://github.com/svg/svgo/pull/1559)
- prefixIds (https://github.com/svg/svgo/pull/1561)
- sortAttrs (https://github.com/svg/svgo/pull/1564)
Also fixed a few bugs
- add xmlns:xlink in reusePaths plugin when missing (https://github.com/svg/svgo/pull/1555)
- fixed removeNone param in removeUselessStrokeAndFill plugin (https://github.com/svg/svgo/pull/1549)
Thanks to @XhmikosR, @matheus1lva, @deepsweet, @omgovich, @adalinesimonian and @TrySound
v2.5.0
In this release we have a couple of fixes
- fixed removing transform-origin attribute (https://github.com/svg/svgo/commit/680e143daf622bc3ace9e0b82f626507caad0530)
- fixed applying transform to path arc with zero radius (https://github.com/svg/svgo/commit/ac8edbaf4163fd7e0934b72175d60e71844d8cf9)
Visitor api now get parentNode in enter and exit callback
return {
element: {
enter: (node, parentNode) => {
},
exit: (node, parentNode) => {
}
}
}
And a lot of plugins are migrated to visitor api and covered them with tsdoc
- addAttributesToSVGElement
- addClassesToSVGElement
- cleanupAttrs
- cleanupEnableBackground
- cleanupListOfValues
- cleanupNumericValues
- convertColors
- convertEllipseToCircle
- convertShapeToPath
- convertTransform
- mergePaths
- removeAttributesBySelector
- removeAttrs
- removeComments
- removeDesc
- removeDoctype
- removeElementsByAttr
- removeEmptyText
- removeMetadata
- removeRasterImages
- removeScriptElement
- removeStyleElement
- removeTitle
- removeXMLProcInst
- removeHiddenElems
- removeViewBox
- removeUselessDefs
- removeOffCanvasPaths
- removeUnknownsAndDefaults
- sortDefsChildren
Thanks to @XhmikosR, @morganney, @oBusk, @matheus1lva and @TrySound
v2.4.0
Hey everybody!
In this release I happy to introduce the new plugin "preset-default" which allows to declaratively setup and customize default set of plugins. Previous solution extendDefaultPlugins
utility prevented parcel users from using cachable json config, svgo-loader and svgo-jsx required svgo to be installed locally. "preset-default" plugin is just another builtin plugi.
module.exports = {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// customize options
builtinPluginName: {
optionName: 'optionValue',
},
// or disable plugins
anotherBuiltinPlugin: false,
},
},
},
],
};
We also fixed a few bugs
- performance is improved by ~37% for svg with styles (https://github.com/svg/svgo/pull/1456)
- reset cursor after "closeto" command when applying transformation (https://github.com/svg/svgo/commit/9e578b515a6b23e6ab4bd41f7b28e2655d3bd110)
- fixed usage of removed internal methods (https://github.com/svg/svgo/pull/1479)
- chalk is replaced with smaller colorette (https://github.com/svg/svgo/pull/1511)
- test files are excluded from published package (https://github.com/svg/svgo/pull/1458)
- remove more spaces around flag in arc command https://github.com/svg/svgo/pull/1484
Thanks to @TrySound, @ydaniv, @ludofischer, @XhmikosR and @joseprio
v2.3.1
Fixed vulnerability in css-select dependency (https://github.com/svg/svgo/pull/1485)
Thanks to @ericcornelissen
v2.3.0
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 (https://github.com/svg/svgo/commit/7389bcddbfadc49de84203b048199b4a397d656a)
- fix rendering -0 in path data (https://github.com/svg/svgo/commit/3d4adb6b044ff1361a970ea049f90d5626ea9888)
- make browser bundle 30% smaller (https://github.com/svg/svgo/commit/279962207e8c99ca8dd9f0ac093071aabafc8721)
- simplified convertPathData plugin (https://github.com/svg/svgo/commit/a04b27a1df12b9e6dc019fb8d50733d3d280a5c5 and https://github.com/svg/svgo/commit/61657433e161b6e5de61d470ac34e302b3aa297b)
- prepared for more regression tests (https://github.com/svg/svgo/commit/d89d36eacec7bd52002ef55ec6e2bd698352123e)
Thanks to @chambo-e, @strarsis, @XhmikosR, @omgovich and @TrySound
v2.2.2
- ignore keyframes in computeStyle (https://github.com/svg/svgo/commit/ddbd7046b2aed8133864b2d98feef6a80f665540)
v2.2.1
This is a big patch with new style computing (https://github.com/svg/svgo/pull/1399) and landed to master regression tests
A lot of bugs are fixed
- fixed scientific notation parsing in paths (https://github.com/svg/svgo/commit/d6f972c970d3cdd68ccc740e1a610ff0b23fcd34)
- forbade invalid
<style>
type attribute in inlineStyles plugin (https://github.com/svg/svgo/pull/1400) - fixed
<style>
support in removeHiddenElems plugin (https://github.com/svg/svgo/pull/1399) - fixed noSpaceAfterFlags option support (https://github.com/svg/svgo/commit/0e02fd9fdef0d031a8393a97af7207577cb86222)
- fixed floatPrecision when extending default plugins (https://github.com/svg/svgo/commit/d58a7e6089ccf15ecc3928427d55e6b9601094af)
- fixed
<style>
support when removing useless path commands (https://github.com/svg/svgo/commit/c21fef54e1aede8cf9f4b4b73ab79d91b7907d2b) - fixed
<style>
support when combining path commands (https://github.com/svg/svgo/commit/ba7e9bdc0d4ee677336f09b6fb24fd6cc866e97d) - prevent removing filter primitive defaults (https://github.com/svg/svgo/commit/555a9619dbc6273c665818a0ade27e5d4ab27a09)
- prevent merging paths with markers (https://github.com/svg/svgo/commit/de4fd79b5779a2e92f45dd06685cec5192067ecd)
- prevent removing single point paths with markers (https://github.com/svg/svgo/commit/21c04e4d8ae2765f3f00a87de7219d69c075bd22)
- keep empty
<pattern>
when at least one argument is present (https://github.com/svg/svgo/commit/0e6b0c4a0182fb79775fb6af2f1df18c12f917d9) - keep
<marker>
with display none (https://github.com/svg/svgo/commit/d3e3726ac42bf623572ff06405e12f4ee72873dd) - preserve empty conditional processing attributes (https://github.com/svg/svgo/commit/a2b0e737670a46955097a5b02fe3daa35c3f231b)
- preserve viewBox in nested
<svg>
(https://github.com/svg/svgo/commit/28c01cfe65cd87796fb061fe3ede7c6f59d0e1f6)
435 of 526 regression tests are passing
Thanks to @XhmikosR @sk- and @TrySound
v2.2.0
Wow, two minor releases in a row. There is a big reason for that. We got a new logo! See it in readme. Big thanks to @DerianAndre.
There were also implemented brand new path data parser and stringifier (https://github.com/svg/svgo/pull/1378 and https://github.com/svg/svgo/pull/1387) to do more reliable transformations and produce smaller svg.
A cup of small fixes
- fixed optimisation when stroke-linecap=round is specified (https://github.com/svg/svgo/commit/7901588a9f18d6ef476389405a73cd7fe42ed179)
- prevented transform applying when inline style is present (https://github.com/svg/svgo/commit/79dbb4bf6e7464e946d838ade0aa23c7189762f7)
- apply transform to stroke-dasharray and stroke-dashoffset (https://github.com/svg/svgo/commit/dd37fcfebbe2f3cea687ad0bf890ff83ab3c9eb7)
- fixed removing hidden elements when descendant enables visibility (https://github.com/svg/svgo/commit/d06747abca1e9e652a764db9747395d14f7f6f98)
- fixed removing elements with zero opacity inside clipPath (https://github.com/svg/svgo/commit/9d67586787ad16799d7a1cfce1eb0bce829470da)
- fixed removing empty mask which can hide elements by id (https://github.com/svg/svgo/commit/d14315b68fc1fcb43212219a0da5857ad7a23cd0)
- fixed removing stroke-width when marker-end is specified (https://github.com/svg/svgo/commit/36391564f2d0b2c7ad86c746bacdd6de030ebd3d)
- fixed
<tspan>
inside<a>
(https://github.com/svg/svgo/commit/091172a392f6d751855477d51e5c8bd3e44fde97)
Thanks to @sk- @XhmikosR @deepsweet and @TrySound
v2.1.0
This release introduced two big changes
- we forked sax parser to fix issues inaccessible from public api (https://github.com/svg/sax)
- we added regression tests which already caught 4 bugs (WIP)
See fixed bugs
- fixed empty
<svg />
with enabled cleanupIDs plugin (https://github.com/svg/svgo/commit/9b97e06ef69b7961f342c9ee8468c552c9b503a3) - fail when file specified in
--config
flag does not exist or json string is specified (https://github.com/svg/svgo/commit/a855b40ec5d53f3ce3b45213fd4c65bc4dc05347) - disabled convertStyleToAttrs by default (https://github.com/svg/svgo/pull/1365)
- preserve whitespace in elements containing text (https://github.com/svg/svgo/pull/1220)
- fixed removing
xml:space="preserve"
(https://github.com/svg/svgo/commit/776ec1e71bcd2aa768b2d3ac987177f706834547) - preserve whitespace in nested textual elements (https://github.com/svg/svgo/commit/9de471a0f4bea20581034c2d74b0652c27e0fad0)
- keep empty
<g>
whenfilter
attribute is specified (https://github.com/svg/svgo/commit/c1d5f0f7a93a6f1c947baa5860ddd40f8d1bb701) - fixed parsing xml entities (https://github.com/svg/svgo/pull/1371 https://github.com/isaacs/sax-js/pull/200)
Thanks to @XhmikosR @sk- @chromakode @devongovett and @TrySound
v2.0.3
- reduced browser build size 1450kB -> 820kB (https://github.com/svg/svgo/commit/82778c872d9fb990c22c431b63843a5bd50175f7)
- fixed adding empty
<defs>
by reusePaths plugin (https://github.com/svg/svgo/pull/1201) - fixed reporting parsing errors (https://github.com/svg/svgo/commit/ea82cc28807a1d77220b9c8bb94ad657f9285e31)
- fixed convertEllipseToCircle plugin when
rx
orry
attributes are not specified (https://github.com/svg/svgo/commit/7f4e05297ade6747a2b6ca63109d75dc9c4ea3c0) - fixed removing mask-type on
<mask>
(https://github.com/svg/svgo/commit/4490d62ee9f83febeb18f4a83a297c544459514a) - fixed removing elements when class is empty in removeElementsByAttr plugin (https://github.com/svg/svgo/commit/d9f68d3be0958f5d0899ae0a361d5f3b1ce12b95)
- disable removing spaces in
<path>
by default to support many broken non-browser environments (https://github.com/svg/svgo/pull/1353) - fixed error message in addAttributesToSVGElement plugin (https://github.com/svg/svgo/commit/c1edce4d2d9e64d026d9cb3de544181198cad5f3)
Thanks to @ChrisRu @XhmikosR @yisibl @TrySound
v2.0.2
- added better docs (https://github.com/svg/svgo/pull/1337)
- removed unsafe usage of Buffer constructor (https://github.com/svg/svgo/pull/1341)
- fixed incorrect regexp in convertStyleToAttrs plugin (https://github.com/svg/svgo/pull/1338)
- fixed swallowing errors in config files (https://github.com/svg/svgo/pull/1342)
Thanks to @XhmikosR and @TrySound
v2.0.1
- fixed path intersection in mergePaths plugin (https://github.com/svg/svgo/pull/1229)
- fixed
--indent
flag in CLI (https://github.com/svg/svgo/pull/1331) - fixed multipass option (https://github.com/svg/svgo/pull/1332, https://github.com/svg/svgo/pull/1177)
- fixed plugins order (https://github.com/svg/svgo/pull/1334)
- detect .svg files in folder case-insensitively (https://github.com/svg/svgo/pull/1316)
Thanks to @sk- @Brooooooklyn @strarsis @AlpayY @TrySound
v2.0.0
Happy to introduce SVGO 2.0. Package size was drastically reduced. Configuration is heavily simplified. Node 10.13+ is required.
- smaller install size
- simplified config format
- added browser ready es module bundle
- API is synchronous
- support only svgo.config.js for external configuration
Config changes
Since early versions plugins configuration was affected by yaml syntax. Though it was not practial in json or javascript for writing and for internal work.
plugins:
- removeViewBox: true
- removeAttr:
attrs: '(fill|stroke)'
{
plugins: [
{
removeViewBox: true
},
{
removeAttr: {
attrs: '(fill|stroke)'
}
}
]
}
In the new version plugins configuration is closer to internal representation.
{
plugins: [
{
name: 'removeViewBox'
},
{
name: 'removeAttr',
params: {
attrs: '(fill|stroke)'
}
}
]
}
In v1 full
flag allowed to disable all default plugins and run only specified
in plugins list. In v2 it's default behaviour. To extend default plugins list
you can use extendDefaultPlugins
utility.
{
plugins: extendDefaultPlugins([
{
name: 'removeViewBox',
active: false,
}
])
}
Loading custom plugin by path was removed in favour of manual import or require.
+const customPlugin = require('./custom-plugin.js')
{
plugins: [
{
name: 'customPlugin',
- path: './custom-plugin.js'
+ ...customPlugin
}
]
}
CLI changes
Painful coa
was replaced with well maintained commander
.
--enable
and --disable
flags are removed. In later versions we will explore
plugins setup via CLI.
Inlined json config is no longer suppored. CLI flags should be used instead.
--config="{multipass:true}"
By default SVGO CLI will search for svgo.config.js
. --config
flag allows
to specify js config with any name.
YAML and JSON configuration is no longer supported for the sake of simplicity and less dependencies.
Node API changes
Initially SVGO was implemented with callback style api to fit sax recommendation. Though in practice api was synchronous and allowed to access the result assigned in callback right after optimisation.
For v1 callback style was replaced with promise api which cannot longer be run synchronously. This was a pain point for many tools and required hacking svgo.
In v2 this pain is considered and api is now synchronous. No hacks necessary.
SVGO class is replaced with optimize
function.
-const { SVGO } = require('svgo')
-const svgo = new SVGO({
- // config
- multipass: true
-})
-svgo.optimize(svgstring, { path: './file.svg' }).then(result => {
- ...
-})
+const { optimize, extendDefaultPlugins } = require('svgo')
+optimize(svgstring, {
+ path: './file.svg',
+ multipass: true,
+})
Some tools require the same logic for resolving svgo config as SVGO CLI.
const { loadConfig, optimize } = require('svgo')
...
const config = await loadConfig()
optimize(svgstring, { path: './file.svg', ...config })
Browser ready bundle
There were a lot of request for this feature in the past.
Now tools like svgomg may use official and tested es module for browsers with optimize
, extendDefaultPlugins
and createContentItem
support.
import {
optimize,
extendDefaultPlugins,
createContentItem
} from 'svgo/dist/svgo.browser.js'
v1.3.2
: 1.3.2 / 30.10.2019
- Fixed TypeError: Cannot set property 'multipassCount' of undefined
v1.3.1
: 1.3.1 / 29.10.2019
- Updated CSSO version to 4.0.2 fixing the issue with empty semicolons ";;" in styles (thanks to @strarsis and @lahmatiy).
-
prefixIds
plugin now runs only once with--multipass
option (by @strarsis). -
cleanupIDs
plugin is prevented from producing a preserved ID, including one which matches a preserved prefix, when minifying (by @thomsj).
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.