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,29 @@
import * as runtimeCore from "@module-federation/runtime-tools/runtime-core";
//#region src/index.ts
function injectExternalRuntimeCorePlugin() {
return {
name: "inject-external-runtime-core-plugin",
version: "2.5.0",
beforeInit(args) {
const globalRef = runtimeCore.Global;
if (!globalRef || typeof globalRef !== "object") return args;
const name = args.options.name;
const version = "2.5.0";
if (globalRef._FEDERATION_RUNTIME_CORE && globalRef._FEDERATION_RUNTIME_CORE_FROM && (globalRef._FEDERATION_RUNTIME_CORE_FROM.name !== name || globalRef._FEDERATION_RUNTIME_CORE_FROM.version !== version)) {
console.warn(`Detect multiple module federation runtime! Injected runtime from ${globalRef._FEDERATION_RUNTIME_CORE_FROM.name}@${globalRef._FEDERATION_RUNTIME_CORE_FROM.version} and current is ${name}@${version}, pleasure ensure there is only one consumer to provider runtime!`);
return args;
}
globalRef._FEDERATION_RUNTIME_CORE = runtimeCore;
globalRef._FEDERATION_RUNTIME_CORE_FROM = {
version,
name
};
return args;
}
};
}
//#endregion
export { injectExternalRuntimeCorePlugin as default };
//# sourceMappingURL=index.js.map