forked from th3cyb3rhub/TheCyberHUB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
45 lines (42 loc) · 1.15 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import dotenv from "dotenv";
import path from "path";
dotenv.config();
let apiUrl;
if (process.env.VITE_API_URL) {
apiUrl = process.env.VITE_API_URL;
} else {
apiUrl = "https://api.thecyberhub.org";
}
export default defineConfig({
resolve: {
alias: { src: path.resolve("./src") },
},
server: {
proxy: {
// "/api": "http://localhost:5000",
// "/api": "https://api.thecyberhub.org",
"/api": {
target: apiUrl,
// target: "https://api.thecyberhub.org",
// target: "https://api-thecyberhub-org.azurewebsites.net",
// target: "https://alpha-testing-please-do-not-hack-us-1.thecyberhub.org",
// target: "https://dev.api.thecyberhub.org",
changeOrigin: true,
secure: false,
},
},
host: "0.0.0.0",
port: 3000,
},
// preview: {
// port: 8080
// },
plugins: [react()],
build: {
rollupOptions: {
external: ["node:path"],
},
},
});