uniViteTemplate/vite/plugins/components.ts
2024-06-21 10:04:26 +08:00

17 lines
532 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { Options } from 'unplugin-vue-components/types';
import Components from 'unplugin-vue-components/vite';
export default function createComponents(options?: Options | undefined) {
return Components({
// 指定组件位置默认是src/components
dirs: ['src/components'],
deep: true, // search for subdirectories
// ui库解析器
// resolvers: [ElementPlusResolver()],
extensions: ['vue'],
// 配置文件生成位置
dts: 'src/types/import-components.d.ts',
...options,
});
}