mirror of
https://github.com/docmost/docmost.git
synced 2025-11-12 17:42:36 +10:00
* feat: standalone collab server * * custom collab server port env * fix collab start script command * * API prefix * Log startup PORT * Tweak collab debounce
40 lines
796 B
TypeScript
40 lines
796 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import * as path from "path";
|
|
|
|
export const envPath = path.resolve(process.cwd(), "..", "..");
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const { APP_URL, FILE_UPLOAD_SIZE_LIMIT, DRAWIO_URL, COLLAB_URL } = loadEnv(
|
|
mode,
|
|
envPath,
|
|
"",
|
|
);
|
|
|
|
return {
|
|
define: {
|
|
"process.env": {
|
|
APP_URL,
|
|
FILE_UPLOAD_SIZE_LIMIT,
|
|
DRAWIO_URL,
|
|
COLLAB_URL,
|
|
},
|
|
APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
|
},
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": "/src",
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": {
|
|
target: APP_URL,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|