Skip to content
Snippets Groups Projects
Verified Commit d4dda4a6 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add manual chunking for libraries and AlekSIS apps

parent a3d3c9d8
No related branches found
No related tags found
1 merge request!1132Resolve "Evaluate use of Vite instead of Webpack"
Pipeline #103771 failed
......@@ -31,6 +31,28 @@ export default defineConfig({
manifest: true,
rollupOptions: {
input: django_values.coreEntrypoint,
output: {
manualChunks(id) {
// Split big libraries into own chunks
if (id.includes("node_modules/vue")) {
return "vue";
} else if (id.includes("node_modules/apollo")) {
return "apollo";
} else if (id.includes("node_modules/graphql")) {
return "graphql";
} else if (id.includes("node_modules")) {
// Fallback for all other libraries
return "vendor";
}
// Split each AlekSIS app in its own chunk
for (const [appPackage, ep] of Object.entries(django_values.appEntrypoints)) {
if (id.includes(ep)) {
return appPackage;
}
}
},
},
},
},
server: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment