generated from uni-helper/vitesse-uni-app
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
55 lines (53 loc) · 1.81 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
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* @Author: weisheng
* @Date: 2024-11-01 11:44:38
* @LastEditTime: 2024-11-01 11:50:45
* @LastEditors: weisheng
* @Description:
* @FilePath: \wot-demo\vite.config.ts
* 记得注释
*/
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniHelperManifest from '@uni-helper/vite-plugin-uni-manifest'
import UniHelperPages from '@uni-helper/vite-plugin-uni-pages'
import UniHelperLayouts from '@uni-helper/vite-plugin-uni-layouts'
import UniHelperComponents from '@uni-helper/vite-plugin-uni-components'
import AutoImport from 'unplugin-auto-import/vite'
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
// https://vitejs.dev/config/
export default async () => {
const UnoCSS = (await import('unocss/vite')).default
return defineConfig({
plugins: [
// https://github.com/uni-helper/vite-plugin-uni-manifest
UniHelperManifest(),
// https://github.com/uni-helper/vite-plugin-uni-pages
UniHelperPages({
dts: 'src/uni-pages.d.ts',
}),
// https://github.com/uni-helper/vite-plugin-uni-layouts
UniHelperLayouts(),
// https://github.com/uni-helper/vite-plugin-uni-components
UniHelperComponents({
resolvers: [WotResolver()],
dts: 'src/components.d.ts',
directoryAsNamespace: true,
}),
Uni(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: ['vue', '@vueuse/core', 'uni-app', {
from: 'uni-mini-router',
imports: ['createRouter', 'useRouter', 'useRoute'],
}],
dts: 'src/auto-imports.d.ts',
dirs: ['src/composables', 'src/stores', 'src/utils'],
vueTemplate: true,
}),
// https://github.com/antfu/unocss
// see unocss.config.ts for config
UnoCSS(),
],
})
}