-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.ts
More file actions
36 lines (35 loc) · 1.12 KB
/
Copy pathvite.config.ts
File metadata and controls
36 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
ignored: ["**/src-tauri/**"],
},
},
build: {
target: "esnext",
minify: "esbuild",
sourcemap: false,
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks: (id) => {
// Monaco is the heaviest dep — keep it in its own chunk so the
// initial paint doesn't pay for the editor until a file is opened.
if (id.includes("node_modules/monaco-editor/")) return "monaco";
// highlight.js bundles ~196 languages by default; isolating it
// lets the lazy MessageBubble/CodeBlock path be its own chunk.
if (id.includes("node_modules/highlight.js/")) return "hljs";
// xterm is only loaded when the terminal panel opens.
if (id.includes("node_modules/@xterm/")) return "xterm";
// React + state stack stays in the entry chunk.
return undefined;
},
},
},
},
});