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