forked from CyferShepard/Jellystat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
47 lines (46 loc) · 1.24 KB
/
vite.config.js
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
import { defineConfig, splitVendorChunkPlugin } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
envPrefix: "JS_",
base: "",
optimizeDeps: {
include: ["react", "react-dom", "react-router-dom", "axios", "react-toastify"],
esbuildOptions: {
loader: {
".js": "jsx",
},
},
},
server: {
// port for exposing frontend
port: 3000,
// port for exposing APIs
proxy: {
"/api": "http://127.0.0.1:3000",
"/proxy": "http://127.0.0.1:3000",
"/stats": "http://127.0.0.1:3000",
"/sync": "http://127.0.0.1:3000",
"/auth": "http://127.0.0.1:3000",
"/backup": "http://127.0.0.1:3000",
"/logs": "http://127.0.0.1:3000",
"/socket.io": "http://127.0.0.1:3000",
"/swagger": "http://127.0.0.1:3000",
"/utils": "http://127.0.0.1:3000",
},
},
target: ["es2015"],
rollupOptions: {
output: {
manualChunks: {
react: ["react"],
"react-dom": ["react-dom"],
"react-router-dom": ["react-router-dom"],
axios: ["axios"],
"react-toastify": ["react-toastify"],
},
},
},
plugins: [react(), splitVendorChunkPlugin()],
envDir: "backend",
});