forked from lucasdillmann/nginx-ignition
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
89 lines (88 loc) · 3.35 KB
/
Copy pathvite.config.ts
File metadata and controls
89 lines (88 loc) · 3.35 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
// @ts-expect-error Types not available
import path from "path"
// @ts-expect-error Types are available even though the IDE says otherwise
import viteReact from "@vitejs/plugin-react"
// @ts-expect-error Types are available even though the IDE says otherwise
import { defineConfig } from "vite"
// https://vitejs.dev/config/
export default defineConfig({
base: "/",
plugins: [viteReact()],
server: {
host: "0.0.0.0",
port: 8080,
proxy: {
"/api": {
target: "http://localhost:8090",
},
},
},
build: {
outDir: "build",
emptyOutDir: true,
chunkSizeWarningLimit: 1750,
rolldownOptions: {
output: {
entryFileNames: "assets/[name].[hash].js",
chunkFileNames: "assets/[name].[hash].js",
assetFileNames: "assets/[name].[hash].[ext]",
codeSplitting: {
groups: [
{
name: "vendor.react",
test: /node_modules[\\/](react|react-dom|react-router-dom)(\/|$)/,
priority: 30,
},
{
name: "vendor.codemirror",
test: /@codemirror[\\/]|@uiw[\\/]|node_modules[\\/]codemirror[\\/]/,
priority: 29,
},
{
name: "vendor.antd-pro",
test: /node_modules[\\/]@ant-design\/(pro-components|pro-provider|pro-utils|pro-card|pro-descriptions|pro-field|pro-layout|pro-list|pro-skeleton|pro-table|pro-form)\//,
priority: 28,
},
{
name: "vendor.antd-charts",
test: /node_modules[\\/]@ant-design\/charts\//,
priority: 27,
},
{
name: "vendor.antd-core",
test: /node_modules[\\/](antd|@ant-design\/(v5-patch-for-react-19|icons-svg|icons|colors|fast-color|cssinjs-utils|cssinjs|react-slick))\//,
priority: 26,
},
{
name: "vendor.antv",
test: /node_modules[\\/]@antv\//,
priority: 25,
},
{
name: "vendor.utils",
test: /node_modules[\\/](qs|debounce|typescript)\//,
priority: 21,
},
{
name: "vendor.common",
test: /node_modules/,
priority: 10,
},
{
name: "common",
minShareCount: 2,
minSize: 10000,
priority: 5,
},
],
},
},
},
},
resolve: {
alias: {
// @ts-expect-error Types not available
"@": path.resolve(__dirname, "src"),
},
},
})