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

Specify yaml config file failed "Invalid or unexpected token" #1343

Closed
Jancat opened this issue Feb 19, 2021 · 4 comments
Closed

Specify yaml config file failed "Invalid or unexpected token" #1343

Jancat opened this issue Feb 19, 2021 · 4 comments

Comments

@Jancat
Copy link

Jancat commented Feb 19, 2021

This works without config file:

svgo -r -f ./assets

Specify yaml config file failed:

$ svgo -r -f ./assets --config ./config/.svgo.yml
Invalid or unexpected token

./config/.svog.yml:

plugins:
  - removeXMLNS: true
  - removeViewBox: false
  - removeDimensions: true
  - sortAttrs: true

js2svg:
  pretty: true
  indent: ' '

svgo 2.0.1

@TrySound
Copy link
Member

Hi. Yaml is no longer supported. Also config format is changed. You can specify array of strings in this case. See release notes https://github.com/svg/svgo/releases/tag/v2.0.0

@rhymes
Copy link

rhymes commented Feb 19, 2021

Neither the readme nor the release notes make clear how to disable a specific plugin, and things like --disable=removeViewBox on the command line do not work anymore. The documentation hasn't been updated too.

The release notes make it look like we need to list all plugins, overriding the default list but that seem unpractical. I might be mis-reading the release notes.

update: this is probably how, but where does extendDefaultPlugins come from?

{
  plugins: extendDefaultPlugins([
    {
      name: 'removeViewBox',
      active: false,
    }
  ])
}

@TrySound
Copy link
Member

I updated docs here #1337
Please tell if you have any questions.

@rhymes
Copy link

rhymes commented Feb 19, 2021

Thank you @TrySound, that's mighty helpful! :)

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

No branches or pull requests

3 participants