Son CV dans un terminal web en Javascript! https://terminal-cv.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
633 B

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = minifySvg;
var _helpers = require("../helpers");
const svgo = (0, _helpers.optionalRequire)('svgo');
/** Minify SVG with SVGO */
function minifySvg(tree, options, svgoOptions = {}) {
if (!svgo) return tree;
tree.match({
tag: 'svg'
}, node => {
let svgStr = tree.render(node, {
closingSingleTag: 'slash',
quoteAllAttributes: true
});
const result = svgo.optimize(svgStr, svgoOptions);
node.tag = false;
node.attrs = {};
node.content = result.data;
return node;
});
return tree;
}