$ svgo --pretty --config=./.svgo.yml images/icons-original images/icons
The pretty is ofc optional
In case you want to continue with svgSprite to generate icon stacks:
svgSprite({
mode: {
symbol: {
dest : 'sprites',
sprite: 'icons.svg',
inline: true,
example: true,
render: {
scss: true
}
},
}
})
or in case you want to do all by one, this is also possible. We wanted to store the optimized images separately, thats why we split this up.
svgSprite({
mode: {
symbol: {
dest : 'sprites',
sprite: 'icons.svg',
inline: true,
example: true,
render: {
scss: true
}
},
},
shape: {
transform: [
{
svgo: {
plugins: [
{
convertColors: {
currentColor: true
}
},
{ collapseGroups: true },
{ convertShapeToPath: true },
{ mergePaths: true },
{ transformsWithOnePath: true },
{ convertPathData: true },
{ convertTransform: true },
{ removeRasterImages: true },
{ cleanupListOfValues: true },
{ removeUselessStrokeAndFill: true },
{ removeUnusedNS: true },
{ cleanupNumericValues: true },
{ removeUnknownsAndDefaults: true },
{ removeNonInheritableGroupAttrs: true },
{ convertStyleToAttrs: true },
{ cleanupAttrs: true },
{ removeDoctype: true },
{ removeXMLProcInst: true },
{ removeComments: true },
{ removeMetadata: true },
{ removeTitle: true },
{ removeDesc: true }
]
}
}
]
}
})