@finesoft/front 0.1.57 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -240,12 +240,13 @@ async function resolveGeneratedMessages(locale, context) {
|
|
|
240
240
|
}
|
|
241
241
|
async function getGeneratedMessagesLoader() {
|
|
242
242
|
if (typeof globalThis.__FINESOFT_I18N_LOADER__ === "function") return globalThis.__FINESOFT_I18N_LOADER__;
|
|
243
|
-
if (typeof
|
|
243
|
+
if (typeof __FINESOFT_I18N_LOADER_IMPORTER__ !== "function") return;
|
|
244
244
|
try {
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
const imported = await __FINESOFT_I18N_LOADER_IMPORTER__();
|
|
246
|
+
const loader = typeof imported === "function" ? imported : typeof imported?.loadMessages === "function" ? imported.loadMessages : void 0;
|
|
247
|
+
if (!loader) return;
|
|
248
|
+
globalThis.__FINESOFT_I18N_LOADER__ = loader;
|
|
249
|
+
return loader;
|
|
249
250
|
} catch {
|
|
250
251
|
return;
|
|
251
252
|
}
|
|
@@ -3483,7 +3484,7 @@ function finesoftFrontViteConfig(options = {}) {
|
|
|
3483
3484
|
config(userConfig) {
|
|
3484
3485
|
const overrides = {
|
|
3485
3486
|
appType: "custom",
|
|
3486
|
-
define: {
|
|
3487
|
+
define: { __FINESOFT_I18N_LOADER_IMPORTER__: options.i18n?.messagesDir ? `async () => import(${JSON.stringify(GENERATED_I18N_LOADER_ID)})` : "undefined" }
|
|
3487
3488
|
};
|
|
3488
3489
|
if (!process.env.__FINESOFT_SUB_BUILD__) overrides.build = { outDir: userConfig.build?.outDir ?? "dist/client" };
|
|
3489
3490
|
return overrides;
|