-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
41 lines (39 loc) · 1.59 KB
/
vite.config.js
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
import Uni from '@dcloudio/vite-plugin-uni';
import UniHelperComponents from '@uni-helper/vite-plugin-uni-components';
import UniHelperLayouts from '@uni-helper/vite-plugin-uni-layouts';
import UniHelperManifest from '@uni-helper/vite-plugin-uni-manifest';
import UniHelperPages from '@uni-helper/vite-plugin-uni-pages';
import AutoImport from 'unplugin-auto-import/vite';
import { defineConfig } from 'vite';
// 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: '.cache/uni-pages.d.ts'
}),
// https://github.com/uni-helper/vite-plugin-uni-layouts
UniHelperLayouts(),
// https://github.com/uni-helper/vite-plugin-uni-components
UniHelperComponents({
dts: '.cache/components.d.ts',
directoryAsNamespace: true
}),
Uni.default(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: ['vue', '@vueuse/core', 'uni-app'],
dts: '.cache/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()
]
});
};