import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
//支持jsx
import vueJsx from '@vitejs/plugin-vue-jsx';
// 自动导入vue中hook reactive ref等
import AutoImport from "unplugin-auto-import/vite"
//自动导入ui-组件 比如说ant-design-vue element-plus等
import Components from 'unplugin-vue-components/vite';
import {AntDesignVueResolver} from "unplugin-vue-components/resolvers"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
AutoImport({
imports: ['vue', 'vue-router'],
dts: "src/auto-import.d.ts",
resolvers: [AntDesignVueResolver()]
}),
Components({
//importStyle = false 样式就没了
resolvers: [AntDesignVueResolver({importStyle: true, resolveIcons: true})],
}),
],
})
**
git hub 地址
**
这是unplugin-vue-components能自动导入的ui组件库