-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (33 loc) · 1.07 KB
/
Copy pathvite.config.ts
File metadata and controls
34 lines (33 loc) · 1.07 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
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
// Tauri expects a fixed port and should not clear the screen on rebuild.
clearScreen: false,
server: {
port: 1420,
strictPort: true,
},
build: {
rollupOptions: {
output: {
// Split large eager vendors out of the main entry chunk (caching +
// smaller main chunk). pdfjs is left out — it's lazy via PdfView, so it
// already gets its own on-demand chunk.
manualChunks(id) {
if (!id.includes("node_modules")) return;
if (id.includes("@codemirror") || id.includes("/codemirror/")) return "codemirror";
if (id.includes("dockview")) return "dockview";
if (id.includes("@xterm")) return "xterm";
},
},
},
},
// Unit tests (vitest). jsdom gives DOMPurify a window to sanitize against.
test: {
environment: "jsdom",
include: ["src/**/*.{test,spec}.{ts,tsx}"],
},
});