-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
55 lines (54 loc) · 1.65 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
import vitePluginVue from "@vitejs/plugin-vue"
import unpluginAutoImport from "unplugin-auto-import/vite"
import IconsResolver from "unplugin-icons/resolver"
import unpluginIcons from "unplugin-icons/vite"
import { NaiveUiResolver } from "unplugin-vue-components/resolvers"
import unpluginComponents from "unplugin-vue-components/vite"
import { fileURLToPath, URL } from "url"
import { defineConfig } from "vite"
import { comlink as vitePluginComlink } from "vite-plugin-comlink"
import vitePluginInspect from "vite-plugin-inspect"
import vitePluginPages from "vite-plugin-pages"
import utils from "./packages/utilities/vite"
export default defineConfig({
resolve: {
alias: {
"@": fileURLToPath(new URL("./packages", import.meta.url)),
},
},
plugins: [
vitePluginInspect(),
unpluginAutoImport({
dts: fileURLToPath(
new URL("./packages/framework/types/auto-import.d.ts", import.meta.url)
),
imports: ["vue", "vue-router", "@vueuse/core"],
eslintrc: {
enabled: true,
},
}),
unpluginIcons(),
vitePluginVue({
reactivityTransform: true,
}),
vitePluginPages({
dirs: utils.pages.fetchDirs(),
}),
unpluginComponents({
resolvers: [NaiveUiResolver(), IconsResolver()],
dts: fileURLToPath(
new URL("./packages/framework/types/components.d.ts", import.meta.url)
),
}),
vitePluginComlink(),
utils.plugins.ViteGenerateIndex({
dirs: ["packages/*/components", "packages/framework/components/**"],
extension: "ts",
excludeFiles: [/^.+(\.entry\.)/gm],
}),
],
worker: {
format: "es",
plugins: [vitePluginComlink()],
},
})