Files
docmost_custom/apps/client/vite.config.ts
T

63 lines
1.3 KiB
TypeScript
Raw Normal View History

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,
2025-06-09 04:29:27 +01:00
FILE_IMPORT_SIZE_LIMIT,
2025-03-06 13:38:37 +00:00
DRAWIO_URL,
CLOUD,
SUBDOMAIN_HOST,
COLLAB_URL,
2025-04-23 16:07:58 +01:00
BILLING_TRIAL_DAYS,
2025-06-27 10:58:36 +01:00
POSTHOG_HOST,
POSTHOG_KEY,
2025-03-06 13:38:37 +00:00
} = 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-06-09 04:29:27 +01:00
FILE_IMPORT_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,
2025-04-23 16:07:58 +01:00
BILLING_TRIAL_DAYS,
2025-06-27 10:58:36 +01:00
POSTHOG_HOST,
POSTHOG_KEY,
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
};
});