4

I have installed svgo like so:

[sudo] npm install -g svgo

Downloaded the default config from repo:

https://github.com/svg/svgo/blob/master/.svgo.yml

Edited the config like so: ... - minifyStyles - convertStyleToAttrs - cleanupIDs: false - removeRasterImages - removeUselessDefs ...

Replaced the default like so:

svgo --config=custom.yml

As described here:

https://github.com/svg/svgo#cli

I run SVGO like so:

svgo test.svg test.min.svg

...but the plugin I've deactivated (cleanupIDs) is still active.

I've tried to deactivate other plugins too (i.e. removeTitle) but there is no effect on my output file.

Appreciate some guidance!

Sebastian Kreft
  • 7,819
  • 3
  • 24
  • 41
Johan
  • 120
  • 1
  • 10

2 Answers2

4

You can specify the plugin you want enabled or disabled by name, directly in your command line interface:

svgo --enable={cleanupIDs} test.svg -o test.min.svg

This will ensure that the named plugin(s) will be enabled if they are disabled by default, see help screen:

svgo -h

will produce this help screen: https://github.com/svg/svgo#cli where you can find this piece of information:

--disable=PLUGIN : Disable plugin by name,
--enable=PLUGIN : Enable plugin by name, 
svgo --show-plugins

will actually show which plugins are available and which are disabled by default.

VeRo
  • 956
  • 13
  • 27
0

Maybe you need to specify a parameter at the beginning of the custom.yml full: true