Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: How to disable a plugin #1760

Closed
mantagen opened this issue Apr 3, 2023 · 4 comments · Fixed by #1808
Closed

Documentation: How to disable a plugin #1760

mantagen opened this issue Apr 3, 2023 · 4 comments · Fixed by #1808

Comments

@mantagen
Copy link

mantagen commented Apr 3, 2023

There doesn't appear to be any documentation on how to disable a plugin (which is enabled by default).

It seems it used to be:

plugins: [{
  cleanupIds: false
}]

but not any more. I've seen in other issues and stack overflow suggest active: false , eg

plugins: [{
  name: "cleanupIds",
  active: false
}]

but this also doesn't work.

Anyway so I took a look at the plugin source code and it seems that the correct way is:

plugins: [{
  name: "cleanupIds",
  params: {
    cleanupIds: false
  }
}]

I'm thinking it might help others to document this. Happy to submit a PR

Edit: ps. there wasn't a "documentation" option available when I opened the issue, hence the label

@mantagen mantagen added the bug label Apr 3, 2023
@duncandejong
Copy link

duncandejong commented May 7, 2023

https://github.com/svg/svgo#default-preset

Is it possible that you need to do this?:

plugins: [{
      name: "preset-default",
      params: {
        overrides: {
          cleanupIDs: false,
        }
      }
    }]

@LuisAlejandro
Copy link

@duncandejong your suggestion yields this error
image

@SethFalco
Copy link
Member

SethFalco commented Sep 18, 2023

There doesn't appear to be any documentation on how to disable a plugin

There are instructions for it on the README, though it probably could be clearer. ^-^'

https://github.com/svg/svgo#default-preset

your suggestion yields this error image

@LuisAlejandro Since v3.0.0, it's called cleanupIds not cleanupIDs. (Case-sensitive!)

@SethFalco
Copy link
Member

Hey! Thanks for proposing this.

We now have documentation for this here:
https://svgo.dev/docs/preset-default/#disable-a-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants