Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 10:59:21 +08:00

feat: 通过 svgo 自动移除 svg fill 属性

This commit is contained in:
pany 2024-11-22 16:50:27 +08:00
parent 23f5dc9c14
commit 8dec01f011

View File

@ -92,7 +92,19 @@ export default defineConfig(({ mode }) => {
// 生成 SVG 雪碧图
createSvgIconsPlugin({
iconDirs: [resolve(root, "src/assets/icons")],
symbolId: "icon-[dir]-[name]"
symbolId: "icon-[dir]-[name]",
// 自定义 SVGO 配置
svgoOptions: {
plugins: [
// 移除 fill 属性
{
name: "removeAttrs",
params: {
attrs: "fill"
}
}
]
}
}),
// 原子化 CSS
UnoCSS()