1、安装vite-plugin-importer
2、配置vite.config.ts文件
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import usePluginImport from 'vite-plugin-importer'export default defineConfig({plugins: [vue(), vueJsx(),usePluginImport({libraryName: 'ant-design-vue',libraryDirectory: 'es',style(name) {return `${name}/style/index.css`;},})],resolve: {alias: {'@': fileURLToPath(new URL('./src', import.meta.url))}}
})