componentResolver.ts 836 B

123456789101112131415161718192021222324252627
  1. import { VantResolver } from 'unplugin-vue-components/resolvers'
  2. import IconsResolver from 'unplugin-icons/resolver'
  3. import Components from 'unplugin-vue-components/vite'
  4. export const componentResolverPlugin = () => {
  5. return Components({
  6. dirs: ['src/components/resolver'],
  7. // globs: ["src/components/resolver/*/index.{vue}"],
  8. // extensions: ["vue"],
  9. // exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/, /[\\/]\.src[\\/]/],
  10. deep: true,
  11. // globalNamespaces: ["resolver"],
  12. // directoryAsNamespace: true,
  13. // collapseSamePrefixes: true,
  14. // dts: "types/components.d.ts",
  15. resolvers: [
  16. VantResolver(),
  17. IconsResolver({
  18. prefix: 'Icon',
  19. alias: {
  20. spinners: 'svg-spinners'
  21. },
  22. customCollections: ['about']
  23. })
  24. ]
  25. })
  26. }