Independent React, TypeScript and Vite web application for MaskanX. Includes the chat console, agent and persona configuration, MCP client management, model and provider settings, cron jobs, sessions, and diagnostics. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
// Empty means same-origin. A separate deployment sets VITE_MASKANX_API_URL.
|
|
const apiBaseUrl = (
|
|
env.VITE_MASKANX_API_URL ??
|
|
env.BASE_URL ??
|
|
""
|
|
).replace(/\/+$/, "");
|
|
const proxyTarget =
|
|
env.VITE_MASKANX_PROXY_TARGET || "http://127.0.0.1:8088";
|
|
|
|
return {
|
|
define: {
|
|
BASE_URL: JSON.stringify(apiBaseUrl),
|
|
TOKEN: JSON.stringify(env.VITE_MASKANX_API_TOKEN || env.TOKEN || ""),
|
|
MOBILE: false,
|
|
},
|
|
plugins: [react()],
|
|
css: {
|
|
modules: {
|
|
localsConvention: "camelCase",
|
|
generateScopedName: "[name]__[local]__[hash:base64:5]",
|
|
},
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": {
|
|
target: proxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ["diff"],
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, "dist"),
|
|
emptyOutDir: true,
|
|
},
|
|
};
|
|
});
|