123456789101112131415161718192021222324252627282930313233343536373839 |
- import { URL, fileURLToPath } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import UnoCSS from 'unocss/vite'
- import Components from 'unplugin-vue-components/vite'
- import AutoImport from 'unplugin-auto-import/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- UnoCSS(),
- Components({
- dts: true,
- resolvers: [ElementPlusResolver()],
- }),
- AutoImport({
- dts: true, // or a custom path
- include: [
- /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
- /\.vue$/,
- /\.vue\?vue/, // .vue
- /\.md$/, // .md
- ],
- imports: [
- 'vue',
- 'vue-router',
- ],
- resolvers: [ElementPlusResolver()],
- }),
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- },
- },
- })
|