mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
20 lines
504 B
JavaScript
20 lines
504 B
JavaScript
const plugins = [
|
|
{removeDimensions: true},
|
|
{removeScriptElement: true},
|
|
{removeViewBox: false},
|
|
{moveElemsAttrsToGroup: false},
|
|
{convertStyleToAttrs: 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);
|
|
};
|