自动解析和导入 Wltech-UI 组件库
安装
pnpm install @wltech/resolver -D
vite.config.ts
import { defineConfig, loadEnv, type UserConfigExport } from "vite";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import { WltechUIResolver } from "@wltech/resolver";
export default defineConfig(({ command, mode }) => {
const config: UserConfigExport = {
...,
plugins:[
...
AutoImport({
resolvers: [
ElementPlusResolver(),
WltechUIResolver()
],
}),
Components({
resolvers: [
ElementPlusResolver(),
WltechUIResolver()
],
}),
...
],
...
}
return config
}