fix(ui): fix icons generation script to properly trim svg attrs

This commit is contained in:
sylenien 2022-05-17 11:16:49 +02:00 committed by Delirium
parent 536bacad64
commit 0617e8b485

View file

@ -8,8 +8,7 @@ const ICONS_DIRNAME = 'app/svg/icons';
const UI_DIRNAME = 'app/components/ui';
const svgo = new SVGO({ plugins: [
//"width", "height", <- sometimes eating useful attrs from icons and break them
{ removeAttrs: { attrs: [ "class", "data-name", "dataName" ] } },
{ removeAttrs: { attrs: [ "class", "data-name", "dataName", "svg:width", "svg:height" ] } },
{ addAttributesToSVGElement: { attributes: [ "width={ `${ width }px` }", "height={ `${ height }px` }" ] } },
{ convertPathData: true }, // ?
{ removeViewBox: false }, // ?