From 878db9a37b81f0be2ecb3d369c9eb08955ebda82 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Tue, 9 Jun 2026 12:24:47 +0200 Subject: [PATCH] build(web): split framework deps into cache-stable vendor chunks (#67) --- web/vite.config.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/web/vite.config.ts b/web/vite.config.ts index 1b66e94..0f50d13 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -16,6 +16,26 @@ export default defineConfig({ "@": path.resolve(__dirname, "./src") } }, + build: { + rollupOptions: { + output: { + manualChunks(id) { + if (/[\\/]node_modules[\\/]\.pnpm[\\/](react|react-dom|react-router|react-router-dom)@/.test(id)) { + return "react"; + } + if (/[\\/]node_modules[\\/]\.pnpm[\\/]@base-ui\+react@/.test(id)) { + return "base-ui"; + } + if (/[\\/]node_modules[\\/]\.pnpm[\\/]@tanstack\+react-query@/.test(id)) { + return "query"; + } + if (/[\\/]node_modules[\\/]\.pnpm[\\/](i18next|react-i18next)@/.test(id)) { + return "i18n"; + } + } + } + } + }, server: { proxy: { "/api": "http://localhost:8080",