From 83110659db27f5cc12b237a9308a556f09475479 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 19 Mar 2026 13:38:01 +0100 Subject: [PATCH] Refactor manual chunking in Vite configuration to improve code clarity and maintainability. The updated logic now checks for 'node_modules' and categorizes dependencies into 'vue-vendor' and 'socket-vendor' chunks accordingly. --- client/vite.config.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/client/vite.config.js b/client/vite.config.js index 8ec5a2b..7c30a02 100644 --- a/client/vite.config.js +++ b/client/vite.config.js @@ -46,9 +46,17 @@ export default defineConfig({ minify: 'terser', rollupOptions: { output: { - manualChunks: { - 'vue-vendor': ['vue', 'vue-router', 'pinia'], - 'socket-vendor': ['socket.io-client'] + manualChunks(id) { + if (id.includes('node_modules')) { + if (id.includes('vue') || id.includes('vue-router') || id.includes('pinia')) { + return 'vue-vendor'; + } + if (id.includes('socket.io-client')) { + return 'socket-vendor'; + } + } + // Standard-Chunks Vite überlassen + return undefined; } } }