0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00
penpot/vendor/svgclean/main.js

24 lines
522 B
JavaScript
Raw Normal View History

const plugins = [
2021-01-13 04:46:24 -05:00
{removeDimensions: true},
// {removeXMLNS: false},
2021-01-13 04:46:24 -05:00
{removeScriptElement: true},
{removeViewBox: false},
{moveElemsAttrsToGroup: false},
{
convertPathData: {
lineShorthands: false,
curveSmoothShorthands: false,
forceAbsolutePath: 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);
};