bin/process-svg.js
function optimize(svg) {
  const svgo = new Svgo({
    plugins: [
      { convertShapeToPath: false },
      { mergePaths: false },
      { removeAttrs: { attrs: '(fill|stroke.*)' } },
      { removeTitle: true },
    ],
  });

  return new Promise(resolve => {
    svgo.optimize(svg, ({ data }) => resolve(data));
  });
}
function optimize(svg) {
  const svgo = new Svgo({
    plugins: [
      { convertShapeToPath: false },
      { mergePaths: false },
      { removeAttrs: { attrs: '(fill|stroke.*)' } },
      { removeTitle: true },
    ],
  });

  return new Promise(resolve => {
    svgo.optimize(svg, ({ data }) => resolve(data));
  });
}
function optimize ( svg ) { const svgo = new Svgo ( { plugins : [ { convertShapeToPath : false } , { mergePaths : false } , { removeAttrs : { attrs : '(fill|stroke.*)' } } , { removeTitle : true } , ] , } ) ; return new Promise ( resolve => { svgo . optimize ( svg , ( { data } ) => resolve ( data ) ) ; } ) ; }
Optimize SVG with `svgo`.
@param {string} svg - An SVG string.
@returns {Promise<string>}
Optimize SVG with svgo .