test: 国际化测试

This commit is contained in:
dataeaseShu 2024-09-03 11:07:08 +08:00
parent ba1908ad98
commit 4cab6f50e5
2 changed files with 4 additions and 0 deletions

View File

@ -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'

View File

@ -31,6 +31,7 @@ export const useI18n = (
return getKey(namespace, key)
}
}
console.log('window.I18nDe-', i18n)
if (!i18n) {
return normalFn