-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathvite.config.js
More file actions
54 lines (47 loc) · 1.36 KB
/
Copy pathvite.config.js
File metadata and controls
54 lines (47 loc) · 1.36 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vite.dev/config/
export default defineConfig({
base: "/",
plugins: [react()],
build: {
rollupOptions: {
output: {
// Use function syntax instead of object for manualChunks
manualChunks(id) {
// Core React vendor
if (id.includes("node_modules")) {
// React core
if (id.includes("react") && !id.includes("react-lottie")) {
return "vendor-react";
}
// Firebase
if (id.includes("firebase")) {
return "vendor-firebase";
}
// Lottie animations
if (id.includes("lottie")) {
return "vendor-animations";
}
// Lucide icons (large library)
if (id.includes("lucide-react")) {
return "vendor-icons";
}
// Framer motion
if (id.includes("framer-motion")) {
return "vendor-motion";
}
// Swiper (Carousel)
if (id.includes("swiper")) {
return "vendor-swiper";
}
// All other node_modules
return "vendor";
}
},
},
},
// Increase chunk size warning limit to 2MB
chunkSizeWarningLimit: 2000,
},
});