Skip to content

Commit 4db7e39

Browse files
committed
change bundling behavior
1 parent db8ec8e commit 4db7e39

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ui/vite.config.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,29 @@ export default defineConfig({
3636
manualChunks(id) {
3737
const HugeLibraries = [
3838
"@mantine",
39+
"moment-timezone",
40+
"moment",
3941
"@azure",
4042
"@tabler",
4143
"axios",
42-
"react-pdf",
44+
"react-router",
4345
]; // modify as required based on libraries in use
4446
if (
4547
HugeLibraries.some((libName) =>
4648
id.includes(`node_modules/${libName}`),
4749
)
4850
) {
49-
return id
51+
return `vendor/${id
5052
.toString()
5153
.split("node_modules/")[1]
5254
.split("/")[0]
53-
.toString();
55+
.toString()}`;
56+
}
57+
if (id.includes("node_modules")) {
58+
return `vendor/main`;
59+
}
60+
if (id.includes("src/common")) {
61+
return "common";
5462
}
5563
},
5664
},

0 commit comments

Comments
 (0)