2024-05-22 23:24:57 +01:00
|
|
|
import { defineConfig, loadEnv } from "vite";
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import * as path from "path";
|
2023-10-20 17:12:08 +01:00
|
|
|
|
2024-05-22 23:24:57 +01:00
|
|
|
export const envPath = path.resolve(process.cwd(), "..", "..");
|
|
|
|
|
|
|
|
export default defineConfig(({ mode }) => {
|
2025-03-06 13:38:37 +00:00
|
|
|
const {
|
|
|
|
APP_URL,
|
|
|
|
FILE_UPLOAD_SIZE_LIMIT,
|
|
|
|
DRAWIO_URL,
|
|
|
|
CLOUD,
|
|
|
|
SUBDOMAIN_HOST,
|
|
|
|
COLLAB_URL,
|
|
|
|
} = loadEnv(mode, envPath, "");
|
2024-05-22 23:24:57 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
define: {
|
|
|
|
"process.env": {
|
|
|
|
APP_URL,
|
2024-11-28 18:48:25 +00:00
|
|
|
FILE_UPLOAD_SIZE_LIMIT,
|
2025-02-25 13:15:51 +00:00
|
|
|
DRAWIO_URL,
|
2025-03-06 13:38:37 +00:00
|
|
|
CLOUD,
|
|
|
|
SUBDOMAIN_HOST,
|
2025-02-25 13:15:51 +00:00
|
|
|
COLLAB_URL,
|
2024-05-22 23:24:57 +01:00
|
|
|
},
|
2025-02-25 13:15:51 +00:00
|
|
|
APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
2024-05-22 23:24:57 +01:00
|
|
|
},
|
|
|
|
plugins: [react()],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"@": "/src",
|
|
|
|
},
|
|
|
|
},
|
2024-07-05 16:25:00 +12:00
|
|
|
server: {
|
|
|
|
proxy: {
|
|
|
|
"/api": {
|
|
|
|
target: APP_URL,
|
2025-03-06 13:38:37 +00:00
|
|
|
changeOrigin: false,
|
|
|
|
},
|
|
|
|
"/socket.io": {
|
|
|
|
target: APP_URL,
|
|
|
|
ws: true,
|
|
|
|
rewriteWsOrigin: true,
|
|
|
|
},
|
|
|
|
"/collab": {
|
|
|
|
target: APP_URL,
|
|
|
|
ws: true,
|
|
|
|
rewriteWsOrigin: true,
|
2024-07-05 16:25:00 +12:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-05-22 23:24:57 +01:00
|
|
|
};
|
|
|
|
});
|