Files
dsh-web/web/vite.config.ts
T
m1saka 9a71772771 Harden image admission, resource recovery and session renewal
Add exact-image compatibility policy, experimental admission, paginated build history and shared reauthentication checks. Preserve uncertain Docker creation records, bound frontend resource waits and renew runtime sessions proactively.

Lazy-load and split Monaco, add regression and opt-in live Docker fault tests, and record full race and real-browser acceptance results.
2026-10-14 13:41:54 +08:00

30 lines
1.5 KiB
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
build: {
rollupOptions: {
output: {
// Keep shared Vite helpers out of Monaco chunks so the entry stays lazy.
onlyExplicitManualChunks: true,
manualChunks(id) {
const path = id.split("/monaco-editor/esm/vs/")[1];
if (!path || path.includes("?worker")) return;
const parts = path.split("/");
if (parts[0] === "base") return `monaco-base-${parts[1]}`;
if (path.startsWith("editor/common/core/")) return "monaco-editor-core";
if (path.startsWith("editor/common/diff/")) return "monaco-editor-diff";
if (path.startsWith("editor/common/config/")) return "monaco-editor-config";
if (path.startsWith("editor/common/viewLayout/") || path.startsWith("editor/common/viewModel/")) return "monaco-editor-view-model";
if (path.startsWith("editor/browser/config/")) return "monaco-editor-browser-config";
// Multi-diff imports diff widgets; splitting them creates a chunk cycle.
if (path.startsWith("editor/browser/widget/diffEditor/") || path.startsWith("editor/browser/widget/multiDiffEditor/")) return "monaco-editor-diff-widget";
if (parts[0] === "editor") return `monaco-editor-${parts[1]}`;
return `monaco-${parts[0]}`;
},
},
},
},
server: { host: "127.0.0.1", proxy: { "/api": "http://127.0.0.1:8088", "/dsh": { target: "http://127.0.0.1:8088", ws: true } } },
});