-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
66 lines (65 loc) · 2.04 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
64
65
66
import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
define: {
"process.env.FEED_OWNER_ADDRESS":
JSON.stringify(env.FEED_OWNER_ADDRESS) ??
JSON.stringify("f4ba07294929857359929d55bec87fc869487c73"),
"process.env.STAMP":
JSON.stringify(env.STAMP) ??
JSON.stringify(
"0000000000000000000000000000000000000000000000000000000000000000"
),
"process.env.PR_NUMBER":
JSON.stringify(env.PR_NUMBER) ?? JSON.stringify("unknown-version"),
"process.env.PR_TIMESTAMP":
JSON.stringify(env.PR_TIMESTAMP) ?? JSON.stringify("unknown-timestamp"),
"process.env.HEALTH_CHECK_DATA_REF":
JSON.stringify(env.HEALTH_CHECK_DATA_REF) ??
JSON.stringify(
"2fdbf84ba761d65f3b848f22cf3c0f6899c61ada4347b9a1b3fcf0ea27dde6b3"
),
"process.env.BEE_API_URL":
JSON.stringify(env.BEE_API_URL) ??
JSON.stringify("http://localhost:1633/"),
"process.env.BACKEND_API_URL":
JSON.stringify(env.BACKEND_API_URL) ??
JSON.stringify(
"https://devcon-backend-1074429022647.asia-southeast1.run.app/"
),
"process.env.GATEWAY": JSON.stringify(env.GATEWAY) ?? JSON.stringify(""),
"process.versions": JSON.stringify({ node: "browser-mock" }), // Mocking process.versions.node
},
plugins: [
react(),
nodePolyfills({
globals: { process: true, Buffer: true },
}),
],
base: env.BASE_URL ?? "/DevconAgora/",
resolve: {
alias: {
stream: "stream-browserify",
},
},
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler", // or 'modern'
},
},
},
server: {
watch: {
usePolling: true,
},
host: true,
strictPort: true,
port: 5173,
},
};
});