uniViteTemplate/vite/plugins/components.ts
2024-10-03 13:57:48 +08:00

16 lines
489 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库解析器
extensions: ['vue'],
// 配置文件生成位置
dts: 'src/types/import-components.d.ts',
...options,
});
}