forked from side-peek/sidepeek_frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
48 lines (47 loc) ยท 1.06 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
import react from "@vitejs/plugin-react"
import { visualizer } from "rollup-plugin-visualizer"
import { defineConfig, splitVendorChunkPlugin } from "vite"
import viteCompression from "vite-plugin-compression"
import tsconfigPaths from "vite-tsconfig-paths"
export default defineConfig(({ command }) => ({
plugins: [
react(),
tsconfigPaths(),
splitVendorChunkPlugin(),
viteCompression({
algorithm: "gzip",
ext: ".gz",
}),
],
server: {
proxy: {
"/api": {
target: "http://3.39.156.144:8080",
changeOrigin: true,
},
},
},
build: {
chunkSizeWarningLimit: 1600,
rollupOptions: {
plugins: [
visualizer({
open: false,
gzipSize: true,
brotliSize: true,
}),
],
output: {
manualChunks: (id) => {
if (id.includes("node_modules")) {
return id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString()
}
},
},
},
},
}))