You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
java/model/web/build/vite/plugins/component.ts

37 lines
961 B

/**
* @name AutoRegistryComponents
* @description 按需加载,自动引入组件
*/
import Components from 'unplugin-vue-components/vite';
import {
ElementPlusResolver,
VueUseComponentsResolver,
AntDesignVueResolver,
TDesignResolver,
NaiveUiResolver,
} from 'unplugin-vue-components/resolvers';
export const AutoRegistryComponents = () => {
return Components({
dirs: ['src/components'],
extensions: ['vue'],
deep: true,
dts: 'types/components.d.ts',
directoryAsNamespace: false,
globalNamespaces: [],
directives: true,
importPathTransform: (v) => v,
allowOverrides: false,
include: [/\.vue$/, /\.vue\?vue/],
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
resolvers: [
ElementPlusResolver(),
VueUseComponentsResolver(),
AntDesignVueResolver(),
TDesignResolver({
library: 'vue-next',
}),
NaiveUiResolver(),
],
});
};