Detects if a redundant linearGradient or radialGradient is used with
only a single stop, which effectively means a solid color.
If this is found, just remove the gradient and replace references to it
with the color of the first and only stop defined.
Preview: https://github.com/ADTC/svgo/blob/patch-1/README.md
* Split up code blocks by moving text outside them. (This also ensures
that the Copy function makes sense. _See screenshot:_)
* <img width="380" alt="image"
src="https://user-images.githubusercontent.com/6047296/211246090-64749e5f-3f1e-413b-be39-a99fa2f1b425.png">
* Remove the redundant list of default plugins and refer to the table
instead.
* Sort the table of plugins alphabetically. (It's easier to scan for a
plugin.)
* _I suggest maintaining the sort when adding new items._
* Replace the enabled/disabled code in Default column with just Yes or
blank.
* Tabulate the "Other ways to use" section and remove redundant "as
a/an".
* Correct the word Donators to Donors.
* Add a new section called _Troubleshooting_.
I just spent quite a while trying to upgrade to svgo 2.3 because I was thinking that all the configuration I was passing to `extendDefaultPlugins()` previously should now be in `preset-default` overrides.
Just adding some examples of enabling other builtin plugins could clarify it?
Maybe I was just being stupid, but a thought :)
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
I saw complaints about `extendDefaultPlugins` api
- it cannot be used when svgo is installed globally
- it requires svgo to be installed when using svgo-loader or svgo-jsx
- it prevents using serializable config formats like json
In this diff I introduced the new plugin which is a bundle of all
default plugins.
```js
module.exports = {
plugins: [
'preset_default',
// or
{
name: 'preset_default',
floatPrecision: 4,
overrides: {
convertPathData: {
applyTransforms: false
}
}
}
]
}
```