- POST /api/client-log endpoint in http.ts (Hono, no auth, 204 response) prints batched log entries to stdout so `docker compose logs` shows them - New src/utils/remote-log.ts: remoteLog/remoteWarn batch to backend every 500ms - Replace all bracket-tagged diagnostic console.log/warn calls in main.tsx and ToolCallStatus.tsx with remoteLog/remoteWarn (tags: thread-ui, ui-debug, render-msg, orphan-match, orphan-name-match, orphan-result, streaming-orphan, tool-ui-match) - Add /api/client-log proxy entry to vite.config.ts so dev server forwards the request to the LangGraph backend (port 2024) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
85 lines
2.9 KiB
TypeScript
85 lines
2.9 KiB
TypeScript
import path from "path";
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
// Force refractor/hastscript@6 to use property-information@5 (CJS-compatible).
|
|
// pnpm resolves hastscript@6's transitive dep to v7 (ESM-only) at runtime,
|
|
// causing Vite's commonjs resolver to fail on the refractor→hastscript chain.
|
|
"property-information": path.resolve(
|
|
__dirname,
|
|
"node_modules/.pnpm/property-information@5.6.0/node_modules/property-information"
|
|
),
|
|
},
|
|
},
|
|
build: {
|
|
commonjsOptions: {
|
|
// Allow Rollup to transform CJS modules that import ESM-only packages
|
|
// (e.g. refractor → property-information@7 which is ESM-only)
|
|
transformMixedEsModules: true,
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
"vendor-react": ["react", "react-dom"],
|
|
"vendor-langgraph": ["@langchain/langgraph-sdk"],
|
|
"vendor-assistant-ui": [
|
|
"@assistant-ui/react",
|
|
"@assistant-ui/react-markdown",
|
|
"@assistant-ui/react-syntax-highlighter",
|
|
],
|
|
"vendor-radix": [
|
|
"@radix-ui/react-avatar",
|
|
"@radix-ui/react-dialog",
|
|
"@radix-ui/react-label",
|
|
"@radix-ui/react-slot",
|
|
"@radix-ui/react-tooltip",
|
|
],
|
|
"vendor-markdown": [
|
|
"react-markdown",
|
|
"remark-gfm",
|
|
"remark-math",
|
|
"rehype-katex",
|
|
"katex",
|
|
],
|
|
"vendor-charts": ["recharts", "framer-motion"],
|
|
"vendor-router": ["react-router-dom"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
proxy: {
|
|
// Proxy all LangGraph API calls through Vite dev server
|
|
// so browser uses same origin (:5173) and Docker internal DNS resolves langgraph-dev
|
|
"/threads": {
|
|
target: process.env.LANGGRAPH_BACKEND_URL ?? process.env.VITE_LANGGRAPH_URL ?? "http://localhost:2024",
|
|
changeOrigin: true,
|
|
},
|
|
"/runs": {
|
|
target: process.env.LANGGRAPH_BACKEND_URL ?? process.env.VITE_LANGGRAPH_URL ?? "http://localhost:2024",
|
|
changeOrigin: true,
|
|
},
|
|
"/assistants": {
|
|
target: process.env.LANGGRAPH_BACKEND_URL ?? process.env.VITE_LANGGRAPH_URL ?? "http://localhost:2024",
|
|
changeOrigin: true,
|
|
},
|
|
"/store": {
|
|
target: process.env.LANGGRAPH_BACKEND_URL ?? process.env.VITE_LANGGRAPH_URL ?? "http://localhost:2024",
|
|
changeOrigin: true,
|
|
},
|
|
"/api/client-log": {
|
|
target: process.env.LANGGRAPH_BACKEND_URL ?? process.env.VITE_LANGGRAPH_URL ?? "http://localhost:2024",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|