-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (38 loc) · 961 Bytes
/
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
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import dotenv from "dotenv";
export default defineConfig(({ command, mode }) => {
const MODE = process.env.NODE_ENV || "production";
const VITE_MODE = process.env.VITE_MODE || "production";
const env = loadEnv(mode, process.cwd(), "");
dotenv.config({
path: path.join(path.resolve(), ".env"),
});
const HOST = process.env.HOST;
const PORT = process.env.PORT || 5000;
return {
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
},
base:
VITE_MODE === "local"
? "./"
: MODE === "production"
? "/meeting-minutes/"
: "./",
server: {
host: HOST,
port: +PORT,
},
build: {
outDir:
VITE_MODE === "local"
? "dist2"
: MODE === "production"
? "dist"
: "dist2",
},
plugins: [react()],
};
});