import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import IconsResolver from 'unplugin-icons/resolver'
export default () => {
  return Components({
    resolvers: [
      // 自动导入 Element Plus 组件
      ElementPlusResolver(),
      // 自动注册图标组件
      IconsResolver({
        // 图标库，其他图标库 https://icon-sets.iconify.design/
        enabledCollections: ['ep']
      })
    ],
    // 指定自定义组件位置(默认:src/components)
    dirs: ['src/components', 'src/**/components', 'src/**/container', 'src/**/components/**/*.vue', 'src/**/container/**/*.vue'],
    // 指定自动导入组件TS类型声明文件路径 (false:关闭自动生成)
    // dts: false
    dts: 'src/types/auto-components.d.ts'
  })
}
