Svgo: use json as config

Created on 24 Aug 2016  路  6Comments  路  Source: svg/svgo

Sinceyml is not as well known asJSON and also opens a lot more potential issues I think it would be nice to offer an option to define config in a JSON file instead.

IMHO the yml syntax is irritating and results in issues e.g. #558

Most helpful comment

A JavaScript config option would be good to so that environment arguments can be utilised.

All 6 comments

I think JS files are the most straightforward, since you can put inline functions etc.

@derhuerst I don't disagree ;)

JSON is the main format for a lot of tools (.eslintrc, .babelrc ...) hence the suggestion.

IMHO js and json are better than yml at least when working in a node environment

Actually, one can pass a json file as a config.

@GreLI Or can you give an example of json config ?

It's same as YML just in JSON.

{
  "plugins": [
    "removeDoctype",
    "removeXMLProcInst",
    "removeComments",
    "removeMetadata"
  ]
}

A JavaScript config option would be good to so that environment arguments can be utilised.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elidupuis picture elidupuis  路  5Comments

bdkjones picture bdkjones  路  3Comments

onlymega picture onlymega  路  6Comments

niftylettuce picture niftylettuce  路  4Comments

bmcminn picture bmcminn  路  4Comments