forked from dullage/flatnotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
70 lines (68 loc) · 1.66 KB
/
vite.config.js
File metadata and controls
70 lines (68 loc) · 1.66 KB
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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
const devApiUrl = "http://127.0.0.1:8000";
export default defineConfig({
plugins: [vue()],
root: "client",
base: "",
build: {
// Toast UI Editor and syntax highlighting are intentionally heavy.
chunkSizeWarningLimit: 1600,
rollupOptions: {
output: {
manualChunks(id) {
if (!id.includes("node_modules")) {
return;
}
if (
id.includes("@toast-ui/editor") ||
id.includes("@toast-ui/editor-plugin-code-syntax-highlight") ||
id.includes("prismjs")
) {
return "toast-ui";
}
if (
id.includes("vue") ||
id.includes("pinia") ||
id.includes("vue-router")
) {
return "vue-vendor";
}
if (
id.includes("primevue") ||
id.includes("@jamescoyle/vue-icon") ||
id.includes("@mdi/")
) {
return "ui-vendor";
}
},
},
},
},
server: {
// Note: The FLATNOTES_PATH_PREFIX environment variable is not supported by the dev server
port: 8080,
proxy: {
"/api/": {
target: devApiUrl,
changeOrigin: true,
},
"/attachments/": {
target: devApiUrl,
changeOrigin: true,
},
"/docs": {
target: devApiUrl,
changeOrigin: true,
},
"/openapi.json": {
target: devApiUrl,
changeOrigin: true,
},
"/health": {
target: devApiUrl,
changeOrigin: true,
},
},
},
});