From 4cab6f50e5fc7e10ed4ae285ae6e00dc2ed6e051 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 3 Sep 2024 11:07:08 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=9B=BD=E9=99=85=E5=8C=96=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/config/distributed.ts | 3 +++ core/core-frontend/src/hooks/web/useI18n.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/core/core-frontend/config/distributed.ts b/core/core-frontend/config/distributed.ts index 453ae3f25b..1062d4006a 100644 --- a/core/core-frontend/config/distributed.ts +++ b/core/core-frontend/config/distributed.ts @@ -21,6 +21,9 @@ export default { entryFileNames: `js/[name]-${pkg.version}-${pkg.name}.js`, manualChunks(id: string, { getModuleInfo }) { if (id.includes('node_modules')) { + if (getModuleInfo(id).code.length < 10000) { + return 'node_modules_de' + } return id.toString().split('node_modules/')[1].split('/')[0].toString() } else if (id.includes('.vue') && getModuleInfo(id).code.length < 10000) { return 'vendor' diff --git a/core/core-frontend/src/hooks/web/useI18n.ts b/core/core-frontend/src/hooks/web/useI18n.ts index 8e682b6f72..443a0ef4a0 100644 --- a/core/core-frontend/src/hooks/web/useI18n.ts +++ b/core/core-frontend/src/hooks/web/useI18n.ts @@ -31,6 +31,7 @@ export const useI18n = ( return getKey(namespace, key) } } + console.log('window.I18nDe-', i18n) if (!i18n) { return normalFn