-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
35 lines (35 loc) · 932 Bytes
/
vite.config.ts
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
import { defineConfig, splitVendorChunkPlugin } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
splitVendorChunkPlugin()
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
rollupOptions: {
output: {
manualChunks(id: string) {
// creating a chunk to @open-ish deps. Reducing the vendor chunk size
if (id.includes("@open-ish") || id.includes("tslib")) {
return "@open-ish";
}
// creating a chunk to react routes deps. Reducing the vendor chunk size
if (
id.includes("react-router-dom") ||
id.includes("@remix-run") ||
id.includes("react-router")
) {
return "@react-router";
}
},
},
},
},
});