feat: 去除unplugin-icons插件相关逻辑,引入vite-plugin-svg-icons插件封装SvgIcon组件
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
/**
|
||||
* 自动引入 svg 图标
|
||||
* */
|
||||
import Icons from 'unplugin-icons/vite';
|
||||
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
||||
// /**
|
||||
// * 自动引入 svg 图标
|
||||
// * */
|
||||
import { resolve } from '../utils';
|
||||
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
|
||||
export function configIcons() {
|
||||
return Icons({
|
||||
compiler: 'vue3',
|
||||
customCollections: {
|
||||
i: FileSystemIconLoader('./src/assets', (svg) => svg.replace(/^<svg /, '<svg class="eo-i" ')),
|
||||
},
|
||||
});
|
||||
}
|
||||
return createSvgIconsPlugin({
|
||||
iconDirs: [resolve( "src/assets/svg")],
|
||||
symbolId: "icon-[dir]-[name]",
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user