sindresorhus / gulp-imagemin

Minify PNG, JPEG, GIF and SVG images
MIT License
1.9k stars 157 forks source link

Fix svgo example in readme #359

Closed maple3142 closed 2 years ago

maple3142 commented 3 years ago

The usage are changed after #354: https://github.com/imagemin/imagemin-svgo/commit/43888a0389bdd4c8e7790d5c2cea25d497a561ea

bdukes commented 2 years ago

Note that the configuration documentation states:

The default preset of plugins is fully overridden if the plugins field is specified. Use preset-default plugin to customize plugins options.

So the default example may want to include that (or at least a note) so that folks don't think they're only altering one plugin when they're actually removing all of the default plugins.

Maybe this example:

svgo({
  plugins: [
    {
      name: "preset-default",
      params: { overrides: { removeViewBox: false, removeUselessDefs: false } },
    },
  ],
})
bdukes commented 2 years ago

So that other can find this when searching GitHub, the error you see when you're using the older SVGO config is

Plugin name should be specified