forked from eslint/code-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
96 lines (90 loc) · 2.19 KB
/
Copy pathvite.config.ts
File metadata and controls
96 lines (90 loc) · 2.19 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import path from "node:path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [
react({
babel: {
plugins: [["babel-plugin-react-compiler"]],
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
optimizeDeps: {
include: ["@html-eslint/eslint-plugin"],
},
build: {
outDir: "build",
rollupOptions: {
output: {
manualChunks: {
// Core React dependencies (rarely change)
vendor: ["react", "react-dom", "zustand"],
// Heavy parsing libraries (version-dependent)
parsers: [
"espree",
"esquery",
"@eslint/css",
"@eslint/json",
"@eslint/markdown",
"@html-eslint/eslint-plugin",
"eslint-linter-browserify",
"eslint-scope",
],
// UI framework components (stable)
ui: [
"@radix-ui/react-accordion",
"@radix-ui/react-dialog",
"@radix-ui/react-dropdown-menu",
"@radix-ui/react-label",
"@radix-ui/react-popover",
"@radix-ui/react-select",
"@radix-ui/react-slot",
"@radix-ui/react-switch",
"@radix-ui/react-toast",
"@radix-ui/react-toggle",
"@radix-ui/react-toggle-group",
],
// Code editor (large, separate feature)
editor: [
"@uiw/react-codemirror",
"codemirror",
"@codemirror/lang-css",
"@codemirror/lang-html",
"@codemirror/lang-javascript",
"@codemirror/lang-json",
"@codemirror/lang-markdown",
"@codemirror/language",
"@lezer/highlight",
],
// Utilities and styling (frequently changing)
utils: [
"clsx",
"tailwind-merge",
"class-variance-authority",
"lucide-react",
"use-debounced-effect",
],
// Visualization libraries
visualization: ["graphviz-react", "react-resizable-panels"],
},
chunkFileNames: "assets/[name]-[hash].js",
entryFileNames: "assets/[name]-[hash].js",
assetFileNames: "assets/[name]-[hash].[ext]",
},
},
minify: "esbuild",
chunkSizeWarningLimit: 1000,
sourcemap: false,
},
esbuild: {
keepNames: true,
},
define: {
"process.env.NODE_DEBUG": JSON.stringify(process.env.NODE_DEBUG),
},
});