31 lines
1.6 KiB
TypeScript
31 lines
1.6 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
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 } } },
|
|
});
|