Skip to content

Instantly share code, notes, and snippets.

@ahaywood
Last active June 11, 2024 08:46
Show Gist options
  • Save ahaywood/66044d7d2c61821a96ba5a56232094c7 to your computer and use it in GitHub Desktop.
Save ahaywood/66044d7d2c61821a96ba5a56232094c7 to your computer and use it in GitHub Desktop.
svgo Config File

This is a config file to be used with svgo's command line tool.

You can ues it with the following command:

svgo *.svg --config=/PATH-TO-FILE/svgo-config.yml
{
"plugins": [
{
"cleanupAttrs": true
},
{
"removeDoctype": true
},
{
"removeXMLProcInst": true
},
{
"removeComments": true
},
{
"removeMetadata": true
},
{
"removeTitle": true
},
{
"removeDesc": true
},
{
"removeUselessDefs": true
},
{
"removeEditorsNSData": true
},
{
"removeEmptyAttrs": true
},
{
"removeHiddenElems": true
},
{
"removeEmptyText": true
},
{
"removeEmptyContainers": true
},
{
"removeViewBox": false
},
{
"cleanUpEnableBackground": true
},
{
"convertStyleToAttrs": true
},
{
"convertColors": true
},
{
"convertPathData": true
},
{
"convertTransform": true
},
{
"removeUnknownsAndDefaults": true
},
{
"removeNonInheritableGroupAttrs": true
},
{
"removeUselessStrokeAndFill": true
},
{
"removeUnusedNS": true
},
{
"cleanupIDs": true
},
{
"cleanupNumericValues": true
},
{
"moveElemsAttrsToGroup": true
},
{
"moveGroupAttrsToElems": true
},
{
"collapseGroups": true
},
{
"removeRasterImages": false
},
{
"mergePaths": true
},
{
"convertShapeToPath": true
},
{
"sortAttrs": true
},
{
"transformsWithOnePath": false
},
{
"removeDimensions": true
},
{
"removeAttrs": { "attrs": "(stroke|fill)" }
}
]
}
@danxczm
Copy link

danxczm commented May 17, 2024

unfortunately doesn't work for me =(
--config Custom config file, only .js is supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment