import { Plugin } from "vite";
import { readFileSync, readdirSync } from "fs";
let idPerfix = "";
const svgTitle = /", "");
svgRes.push(svg);
}
}
return svgRes;
}
export const svgBuilder = (path: string, perfix = "icon"): Plugin => {
if (path !== "") {
idPerfix = perfix;
const res = findSvgFile(path);
return {
name: "svg-transform",
transformIndexHtml(html): string {
return html.replace(
"
",
`
`
);
},
};
}
};