-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
45 lines (43 loc) · 1002 Bytes
/
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
import path from "node:path";
import UniApp from "@dcloudio/vite-plugin-uni";
import UniComponents from "@uni-helper/vite-plugin-uni-components";
import AutoImport from "unplugin-auto-import/vite";
import { defineConfig } from "vite";
import { NutResolver } from "nutui-uniapp";
function r(...paths: string[]) {
return path.resolve(process.cwd(), ".", ...paths);
}
export default defineConfig({
resolve: {
alias: {
"@": r("src")
}
},
plugins: [
UniComponents({
dts: "types/components.d.ts",
dirs: ["src/components"],
directoryAsNamespace: true,
collapseSamePrefixes: true,
resolvers: [
NutResolver()
]
}),
AutoImport({
dts: "types/auto-imports.d.ts",
imports: [
"vue",
"uni-app",
"pinia",
{
"nutui-uniapp/composables": [
"useNotify",
"useToast"
]
}
]
}),
// @ts-expect-error whatever
UniApp.default()
]
});