-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.mts
78 lines (76 loc) · 2.09 KB
/
vite.config.mts
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import path from "path";
import { FileSystemIconLoader } from "unplugin-icons/loaders";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import solidPlugin from "vite-plugin-solid";
import packageJson from "./package.json";
import { cyclicHmr, generateAppJson } from "./plugins";
const pwa = VitePWA({
registerType: "autoUpdate",
injectRegister: "auto",
devOptions: {
enabled: true,
},
workbox: {
clientsClaim: true,
skipWaiting: true,
cleanupOutdatedCaches: true,
globPatterns: ["**/*.{js,css,ico,png,svg}"],
navigateFallback: null,
},
});
export default defineConfig({
plugins: [
solidPlugin(),
Icons({
compiler: "jsx",
jsx: "preact",
customCollections: {
degabut: FileSystemIconLoader("./src/libs/common/components/icon/icons"),
},
}),
pwa,
generateAppJson,
cyclicHmr,
],
build: {
target: "es6",
rollupOptions: {
output: {
manualChunks: {
"discord-embedded-app-sdk": ["@discord/embedded-app-sdk"],
},
},
},
},
define: {
"import.meta.env.APP_VERSION": JSON.stringify(packageJson.version),
},
server: {
host: true,
port: 3000,
},
resolve: {
alias: {
"@root": path.resolve("./src/apps/root"),
"@app": path.resolve("./src/apps/app"),
"@desktop-overlay": path.resolve("./src/apps/desktop-overlay"),
"@recap": path.resolve("./src/apps/recap"),
"@login": path.resolve("./src/apps/login"),
"@auth": path.resolve("./src/libs/auth"),
"@common": path.resolve("./src/libs/common"),
"@desktop": path.resolve("./src/libs/desktop"),
"@playlist": path.resolve("./src/libs/playlist"),
"@youtube": path.resolve("./src/libs/youtube"),
"@queue": path.resolve("./src/libs/queue"),
"@user": path.resolve("./src/libs/user"),
"@settings": path.resolve("./src/libs/settings"),
"@constants": path.resolve("./src/constants"),
"@media-source": path.resolve("./src/libs/media-source"),
"@spotify": path.resolve("./src/libs/spotify"),
"@discord/embedded-app-sdk": "@discord/embedded-app-sdk",
"@discord": path.resolve("./src/libs/discord"),
},
},
});