Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
//#region src/getSharedFallbackGetter.ts
const getSharedFallbackGetter = ({ shareKey, factory, version, webpackRequire, libraryType = "global" }) => {
const { runtime, instance, bundlerRuntime, sharedFallback } = webpackRequire.federation;
if (!sharedFallback) return factory;
const fallbackItems = sharedFallback[shareKey];
if (!fallbackItems) return factory;
const fallbackItem = version ? fallbackItems.find((item) => item[1] === version) : fallbackItems[0];
if (!fallbackItem) throw new Error(`No fallback item found for shareKey: ${shareKey} and version: ${version}`);
return () => runtime.getRemoteEntry({
origin: webpackRequire.federation.instance,
remoteInfo: {
name: fallbackItem[2],
entry: `${webpackRequire.p}${fallbackItem[0]}`,
type: libraryType,
entryGlobalName: fallbackItem[2],
shareScope: "default"
}
}).then((shareEntry) => {
if (!shareEntry) throw new Error(`Failed to load fallback entry for shareKey: ${shareKey} and version: ${version}`);
return shareEntry.init(webpackRequire.federation.instance, bundlerRuntime).then(() => shareEntry.get());
});
};
//#endregion
export { getSharedFallbackGetter };
//# sourceMappingURL=getSharedFallbackGetter.js.map