forked from SevenTV/Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
63 lines (61 loc) · 1.91 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
56
57
58
59
60
61
62
63
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import { visualizer } from "rollup-plugin-visualizer";
import { defineConfig, loadEnv } from "vite";
// https://vitejs.dev/config/
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
build: {
sourcemap: true,
target: "es2021",
rollupOptions: {
plugins: [visualizer()],
output: {
manualChunks: {
vendor: ["vue", "vue-router", "vue-i18n", "vue-cookie-next"],
gql: ["subscriptions-transport-ws", "graphql"],
apollo: ["apollo-link-context", "@vue/apollo-composable"],
fa: [
"@fortawesome/fontawesome-svg-core",
"@fortawesome/free-brands-svg-icons",
"@fortawesome/free-regular-svg-icons",
"@fortawesome/sharp-solid-svg-icons",
"@fortawesome/vue-fontawesome",
],
routing: [
"./src/router/router.ts",
"./src/router/home.route.ts",
"./src/router/emotes.route.ts",
"./src/router/emote-sets.route.ts",
"./src/router/legal.route.ts",
"./src/router/users.route.ts",
"./src/router/store.route.ts",
"./src/router/admin.route.ts",
],
},
},
},
},
plugins: [vue()],
server: {
port: 4200,
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
"@store": resolve(__dirname, "src/store"),
"@scss": resolve(__dirname, "src/assets/scss"),
"@gql": resolve(__dirname, "src/assets/gql"),
"@components": resolve(__dirname, "src/components"),
"@base": resolve(__dirname, "src/components/base"),
"@utility": resolve(__dirname, "src/components/utility"),
"@directives": resolve(__dirname, "src/directives"),
"@structures": resolve(__dirname, "src/structures"),
"@views": resolve(__dirname, "src/views"),
"@img": resolve(__dirname, "src/assets/img"),
"@locale": resolve(__dirname, "locale"),
},
},
});
};