refactor(vite): 重构 Vite 插件加载机制

This commit is contained in:
严浩
2025-10-23 12:30:24 +08:00
parent f1536ed24c
commit 7b9dee68cc
27 changed files with 383 additions and 258 deletions

View File

@@ -0,0 +1,17 @@
import type { PluginOption } from 'vite';
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
import Icons from 'unplugin-icons/vite';
export default [
Icons({
autoInstall: true,
customCollections: {
svg: FileSystemIconLoader('src/assets/icons/svgs', (svg) => {
return svg.replace(/^<svg /, '<svg fill="currentColor" ');
}),
},
iconCustomizer(collection, icon, properties) {
properties.class = 'unplugin-icons';
},
}),
] satisfies PluginOption;