@module-federation/sdk
Advanced tools
Comparing version 0.0.0-next-20240305014714 to 0.0.0-next-20240306063912
@@ -770,3 +770,4 @@ 'use strict'; | ||
} | ||
function createLink(url, cb, attrs, createLinkHook) { | ||
function createLink(url, cb) { | ||
var attrs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, createLinkHook = arguments.length > 3 ? arguments[3] : void 0; | ||
// <link rel="preload" href="script.js" as="script"> | ||
@@ -780,3 +781,4 @@ // Retrieve the existing script element by its src attribute | ||
var linkHref = l.getAttribute("href"); | ||
if (linkHref && isStaticResourcesEqual(linkHref, url)) { | ||
var linkRef = l.getAttribute("ref"); | ||
if (linkHref && isStaticResourcesEqual(linkHref, url) && linkRef === attrs["ref"]) { | ||
link = l; | ||
@@ -783,0 +785,0 @@ needAttach = false; |
@@ -766,3 +766,4 @@ function _define_property$2(obj, key, value) { | ||
} | ||
function createLink(url, cb, attrs, createLinkHook) { | ||
function createLink(url, cb) { | ||
var attrs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, createLinkHook = arguments.length > 3 ? arguments[3] : void 0; | ||
// <link rel="preload" href="script.js" as="script"> | ||
@@ -776,3 +777,4 @@ // Retrieve the existing script element by its src attribute | ||
var linkHref = l.getAttribute("href"); | ||
if (linkHref && isStaticResourcesEqual(linkHref, url)) { | ||
var linkRef = l.getAttribute("ref"); | ||
if (linkHref && isStaticResourcesEqual(linkHref, url) && linkRef === attrs["ref"]) { | ||
link = l; | ||
@@ -779,0 +781,0 @@ needAttach = false; |
@@ -7,3 +7,3 @@ export declare function safeWrapper<T extends (...args: Array<any>) => any>(callback: T, disableWarn?: boolean): Promise<ReturnType<T> | undefined>; | ||
}; | ||
export declare function createLink(url: string, cb: (value: void | PromiseLike<void>) => void, attrs?: Record<string, any>, createLinkHook?: (url: string) => HTMLLinkElement | void): { | ||
export declare function createLink(url: string, cb: (value: void | PromiseLike<void>) => void, attrs?: Record<string, string>, createLinkHook?: (url: string) => HTMLLinkElement | void): { | ||
link: HTMLLinkElement; | ||
@@ -10,0 +10,0 @@ needAttach: boolean; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.0-next-20240305014714", | ||
"version": "0.0.0-next-20240306063912", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
107649
2679