From 2273bb388f8727bb178211a6ecf35dfcb0ab0734 Mon Sep 17 00:00:00 2001 From: jj Date: Thu, 16 Jan 2025 20:42:58 +0000 Subject: [PATCH] web/vite: split transformers.js into separate chunk --- web/vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/vite.config.ts b/web/vite.config.ts index f762fbbc..e37aebb2 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -88,6 +88,9 @@ export default defineConfig({ rollupOptions: { output: { manualChunks: (id) => { + if (id.includes('huggingface/transformers')) + return 'hf_transformers'; + if (id.includes('/web/i18n') && id.endsWith('.json')) { const lang = id.split('/web/i18n/')?.[1].split('/')?.[0]; if (lang) {