Skip to content

Instantly share code, notes, and snippets.

@jschatz1
Created January 31, 2020 13:23
Show Gist options
  • Save jschatz1/9cede245de6cdbca5fd0e34ce8d657e5 to your computer and use it in GitHub Desktop.
Save jschatz1/9cede245de6cdbca5fd0e34ce8d657e5 to your computer and use it in GitHub Desktop.
const svgconfig = require("./svg.config");
const svgo = new SVGO(svgconfig);
module.exports.svgconfig = {
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
},
{
convertStyleToAttrs: true
},
{
convertColors: true
},
{
convertTransform: true
},
{
removeUnknownsAndDefaults: true
},
{
removeNonInheritableGroupAttrs: true
},
{
removeUselessStrokeAndFill: true
},
{
removeUnusedNS: true
},
{
cleanupIDs: true
},
{
cleanupNumericValues: true
},
{
sortAttrs: true
},
{
removeAttrs: { attrs: "(stroke|fill)" }
}
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment