2021-01-11 05:08:40 -05:00
|
|
|
const plugins = [
|
2021-01-13 04:46:24 -05:00
|
|
|
{removeDimensions: true},
|
2021-01-13 05:40:33 -05:00
|
|
|
// {removeXMLNS: false},
|
2021-01-13 04:46:24 -05:00
|
|
|
{removeScriptElement: true},
|
|
|
|
{removeViewBox: false},
|
|
|
|
{moveElemsAttrsToGroup: false},
|
|
|
|
{
|
|
|
|
convertPathData: {
|
|
|
|
lineShorthands: false,
|
|
|
|
curveSmoothShorthands: false,
|
|
|
|
forceAbsolutePath: true,
|
|
|
|
},
|
|
|
|
},
|
2021-01-11 05:08:40 -05:00
|
|
|
];
|
2021-01-10 13:11:22 -05:00
|
|
|
|
|
|
|
const svgc = require("./src/svgclean.js");
|
2021-01-13 05:40:33 -05:00
|
|
|
const inst = svgc.configure({plugins});
|
2021-01-10 13:11:22 -05:00
|
|
|
|
|
|
|
exports.optimize = function(data) {
|
|
|
|
return svgc.optimize(inst, data)
|
|
|
|
.then((result) => result.data);
|
|
|
|
};
|
2021-01-13 05:40:33 -05:00
|
|
|
|