-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
42 lines (41 loc) · 1.29 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx' // 支持jsx语法
import vueDevTools from 'vite-plugin-vue-devtools'
import VueRouter from 'unplugin-vue-router/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router' // 自动导入路由
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import UnoCSS from 'unocss/vite'
import Layouts from 'vite-plugin-vue-layouts' // 自动导入布局
import ReactivityTransform from '@vue-macros/reactivity-transform/vite' // Vue Macros 插件
// https://vite.dev/config/
export default defineConfig({
plugins: [
VueRouter({
/* options */
}),
Layouts(),
vue(),
vueJsx(),
vueDevTools(),
AutoImport({
imports: ['vue', VueRouterAutoImports, '@vueuse/core', 'pinia'],
resolvers: [ElementPlusResolver()],
dts: './auto-imports.d.ts',
}),
Components({
/* options */
resolvers: [ElementPlusResolver()],
}),
UnoCSS(),
ReactivityTransform(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})