Skip to content

Commit

Permalink
feat: 通过 svgo 自动移除 svg fill 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang committed Nov 22, 2024
1 parent 23f5dc9 commit 8dec01f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8dec01f

Please sign in to comment.