-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathvite.config.ts
48 lines (46 loc) · 1.21 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 { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import * as dotenv from "dotenv";
import * as fs from "fs";
// Load .env.local if it exists to override default environment variables
dotenv.config({ path: ".env" });
if (fs.existsSync(".env.local")) {
dotenv.config({ path: ".env.local" });
}
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
silenceDeprecations: ["mixed-decls", "global-builtin", "import"],
},
},
},
plugins: [tsconfigPaths(), react()],
server: {
port: process.env.VITE_PORT ? Number(process.env.VITE_PORT) : 3000,
strictPort: true,
proxy: {
"/ui/assets": {
target: "https://localhost:8407/",
rewrite: (path) => path.replace(/^\/ui/, ""),
secure: false,
},
"/ui/monaco-editor": {
target: "https://localhost:8407/node_modules",
rewrite: (path) => path.replace(/^\/ui/, ""),
secure: false,
},
},
},
build: {
outDir: "./build/ui",
minify: "esbuild",
},
experimental: {
renderBuiltUrl(filename: string) {
return "/ui/" + filename;
},
},
});