fix: 解决没有 xpack 打包报错的问题 (#4400)

This commit is contained in:
zhengkunwang 2024-04-03 17:40:07 +08:00 committed by GitHub
parent 6ff0f14841
commit bb4fd69f3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 12 deletions

View File

@ -1,9 +1,9 @@
import fit2cloudEnLocale from 'fit2cloud-ui-plus/src/locale/lang/en'; import fit2cloudEnLocale from 'fit2cloud-ui-plus/src/locale/lang/en';
let xpackEnLocale = {}; let xpackEnLocale = {};
try { const xpackModules = import.meta.globEager('../../xpack/lang/en.ts');
const commercialTranslationModule = await import('@/xpack/lang/en'); if (xpackModules['../../xpack/lang/en.ts']) {
xpackEnLocale = commercialTranslationModule.default || {}; xpackEnLocale = xpackModules['../../xpack/lang/en.ts'].default || {};
} catch (error) {} }
const message = { const message = {
commons: { commons: {

View File

@ -1,9 +1,10 @@
import fit2cloudTwLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn'; import fit2cloudTwLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn';
let xpackTwLocale = {}; let xpackTwLocale = {};
try { const xpackModules = import.meta.globEager('../../xpack/lang/tw.ts');
const commercialTranslationModule = await import('@/xpack/lang/tw'); if (xpackModules['../../xpack/lang/tw.ts']) {
xpackTwLocale = commercialTranslationModule.default || {}; xpackTwLocale = xpackModules['../../xpack/lang/tw.ts'].default || {};
} catch (error) {} }
const message = { const message = {
commons: { commons: {
true: '是', true: '是',

View File

@ -1,9 +1,9 @@
import fit2cloudZhLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn'; import fit2cloudZhLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn';
let xpackZhLocale = {}; let xpackZhLocale = {};
try { const xpackModules = import.meta.globEager('../../xpack/lang/zh.ts');
const commercialTranslationModule = await import('@/xpack/lang/zh'); if (xpackModules['../../xpack/lang/zh.ts']) {
xpackZhLocale = commercialTranslationModule.default || {}; xpackZhLocale = xpackModules['../../xpack/lang/zh.ts'].default || {};
} catch (error) {} }
const message = { const message = {
commons: { commons: {