(Translated by https://www.hiragana.jp/)
fix: tabler filled icons stroke-width being removed by svgo (#42) · x64Bits/solid-icons@35c8974 · GitHub
Skip to content

Commit

Permalink
fix: tabler filled icons stroke-width being removed by svgo (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: linhtv <linhtv@salefronts.com>
  • Loading branch information
linkthai and linhtv-salefronts authored Jun 28, 2023
1 parent e68d026 commit 35c8974
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/build/optimize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,27 @@ import {
normalizeTwoTone,
} from "./normalize-packs";
import { svgoConfig } from "./svgo-config";
import { optimize } from "svgo";
import { Output, optimize } from "svgo";
import { NORMALIZE_PACK } from "../constants";

export async function optimizeContents(contents: string, shortName: string) {
const optimizedFile = optimize(contents, svgoConfig);
let optimizedFile: Output;
switch (shortName) {
case NORMALIZE_PACK.TB:
const tbSvgoConfig = {
...svgoConfig,
plugins: svgoConfig.plugins?.filter((plugin) => {
if ((plugin as any).name == "removeAttributesBySelector") {
return false;
}
}),
};
optimizedFile = optimize(contents, tbSvgoConfig);
break;
default:
optimizedFile = optimize(contents, svgoConfig);
break;
}

switch (shortName) {
case NORMALIZE_PACK.IO:
Expand Down

0 comments on commit 35c8974

Please sign in to comment.