Skip to content

Commit 33fd8aa

Browse files
committed
improve chunking, related to Awesome-Technologies/synapse-admin#682
1 parent 70e05b9 commit 33fd8aa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

vite.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ export default defineConfig({
66
base: "./",
77
build: {
88
target: "esnext",
9-
chunkSizeWarningLimit: 1500,
9+
chunkSizeWarningLimit: 1000, // react-admin itself is 500kb, @mui 350kb, and other vendor libs are 730kb+ at the moment of writing
10+
rollupOptions: {
11+
output: {
12+
manualChunks(id) {
13+
if (id.includes("node_modules")) {
14+
if (id.includes("react-admin") || id.includes("ra-")) return "ra";
15+
if (id.includes("@mui")) return "mui";
16+
return "vendor";
17+
}
18+
},
19+
},
20+
},
1021
},
1122
plugins: [
1223
react(),

0 commit comments

Comments
 (0)