0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -05:00
penpot/vendor/svgclean/main.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

const plugins = [
{ "minifyStyles" : false },
{ "convertStyleToAttrs" : false },
{
"cleanupIDs" : {
remove: false,
minify: false,
force: false
}
},
{ "cleanupListOfValues" : true },
{ "removeUnknownsAndDefaults" : false },
{ "removeViewBox" : false },
{ "convertShapeToPath" : false },
{ "convertEllipseToCircle" : false },
{ "moveElemsAttrsToGroup" : false },
2021-03-04 07:44:46 +01:00
{ "moveGroupAttrsToElems" : false },
{ "collapseGroups" : false },
{
"convertPathData" : {
lineShorthands: false,
curveSmoothShorthands: false,
forceAbsolutePath: true,
}
},
{ "convertTransform" : false },
{ "removeEmptyContainers" : false },
{ "mergePaths" : false },
{ "sortDefsChildren" : false },
{ "removeDimensions" : true },
2021-03-04 07:44:46 +01:00
{ "removeStyleElement" : false },
{ "removeScriptElement" : true },
2021-03-01 22:13:19 +01:00
{ "removeOffCanvasPaths" : false },
2021-03-04 07:44:46 +01:00
{ "cleanupNumericValues": true}
];
const svgc = require("./src/svgclean.js");
const inst = svgc.configure({plugins});
exports.optimize = function(data) {
return svgc.optimize(inst, data)
.then((result) => result.data);
};