Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
67 lines (66 loc) · 1.79 KB
/
Copy pathvite.config.ts
File metadata and controls
67 lines (66 loc) · 1.79 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
import path from "node:path";
import tailwindcss from "@tailwindcss/vite";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { getViteBasePath } from "./src/utils/router-base-path";
export default defineConfig({
base: getViteBasePath(process.env.VITE_BASE_PATH),
plugins: [
TanStackRouterVite({
routesDirectory: "./src/routes",
generatedRouteTree: "./src/routeTree.gen.ts",
quoteStyle: "double",
routeFileIgnorePattern: "\\.(test|spec)\\.(ts|tsx)$",
}),
react(),
tailwindcss(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
chunkSizeWarningLimit: 1000,
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: "vendor-react",
test: /node_modules[\\/](react|react-dom|react-is)[\\/]/,
priority: 40,
},
{
name: "vendor-tanstack",
test: /node_modules[\\/]@tanstack[\\/]/,
priority: 30,
},
{
name: "vendor-ui",
test: /node_modules[\\/](@base-ui|@radix-ui|cmdk|vaul)[\\/]/,
priority: 25,
},
{
name: "vendor-rjsf",
test: /node_modules[\\/]@rjsf[\\/]/,
priority: 25,
},
{
name: "vendor-charts",
test: /node_modules[\\/](recharts|d3-.+)[\\/]/,
priority: 25,
},
{
name: "vendor",
test: /node_modules[\\/]/,
maxSize: 900 * 1024,
priority: 1,
},
],
},
},
},
},
});