Skip to content

best way to save what you love

web/build: merge i18n chunks for each language into one file

dumbmorone98f76c8ee15
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: [