unpluginIcons.ts 516 B

123456789101112131415161718
  1. import Icons from 'unplugin-icons/vite'
  2. import { FileSystemIconLoader } from 'unplugin-icons/loaders'
  3. export const unpluginIcons = () => {
  4. return Icons({
  5. compiler: 'vue3',
  6. // 缩放比例
  7. scale: 1,
  8. // defaultClass: "w-1em h-1em",
  9. autoInstall: true,
  10. // https://github.com/antfu/unplugin-icons#custom-icons
  11. customCollections: {
  12. about: FileSystemIconLoader('src/assets/icons/about', (svg) => {
  13. return svg.replace(/^<svg /, '<svg fill="currentColor" ')
  14. })
  15. }
  16. })
  17. }