From 1b3954500762afef2f8ac3cf356e69aa7c5518e9 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Thu, 4 Jul 2024 22:15:15 +0000 Subject: [PATCH] web/build: merge i18n chunks for each language into one file --- web/vite.config.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/vite.config.ts b/web/vite.config.ts index 4d92ae44..d6663e0d 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -5,6 +5,20 @@ export default defineConfig({ plugins: [ sveltekit() ], + build: { + rollupOptions: { + output: { + manualChunks: (id) => { + if (id.includes('/web/i18n')) { + const lang = id.split('/web/i18n/')?.[1].split('/')?.[0]; + if (lang) { + return `i18n_${lang}`; + } + } + } + } + } + }, server: { fs: { allow: [