From 9033363ce2061a6a71ed4d3280e3f507a1eb2e80 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 3 Sep 2024 14:51:22 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=B0=8F=E6=96=87=E4=BB=B6=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/config/distributed.ts | 8 +++++++- core/core-frontend/src/hooks/web/useI18n.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/config/distributed.ts b/core/core-frontend/config/distributed.ts index f915965e70..842ee5f97b 100644 --- a/core/core-frontend/config/distributed.ts +++ b/core/core-frontend/config/distributed.ts @@ -19,9 +19,15 @@ export default { chunkFileNames: `assets/chunk/[name]-${pkg.version}-${pkg.name}.js`, assetFileNames: `assets/[ext]/[name]-${pkg.version}-${pkg.name}.[ext]`, entryFileNames: `js/[name]-${pkg.version}-${pkg.name}.js`, - manualChunks(id: string) { + manualChunks(id: string, { getModuleInfo }) { if (id.includes('node_modules')) { return id.toString().split('node_modules/')[1].split('/')[0].toString() + } else if ( + id.includes('.vue') && + ['App.vue', 'ConfigGlobal.vue', 'ExportExcel.vue'].every(ele => !id.includes(ele)) && + 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 f64bcdd00c..816afd0963 100644 --- a/core/core-frontend/src/hooks/web/useI18n.ts +++ b/core/core-frontend/src/hooks/web/useI18n.ts @@ -28,10 +28,10 @@ export const useI18n = ( } => { const normalFn = { t: (key: string) => { + console.log('window.de-i18nDe', key, namespace) return getKey(namespace, key) } } - console.log('window.de-i18nDe', i18n) if (!i18n) { return normalFn