File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/sdk ' : patch
3
+ ---
4
+
5
+ fix: Avoid style loss due to reuse of link without distinguishing purpose
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ export function createScript(
98
98
export function createLink (
99
99
url : string ,
100
100
cb : ( value : void | PromiseLike < void > ) => void ,
101
- attrs ? : Record < string , any > ,
101
+ attrs : Record < string , string > = { } ,
102
102
createLinkHook ?: ( url : string ) => HTMLLinkElement | void ,
103
103
) {
104
104
// <link rel="preload" href="script.js" as="script">
@@ -110,7 +110,12 @@ export function createLink(
110
110
for ( let i = 0 ; i < links . length ; i ++ ) {
111
111
const l = links [ i ] ;
112
112
const linkHref = l . getAttribute ( 'href' ) ;
113
- if ( linkHref && isStaticResourcesEqual ( linkHref , url ) ) {
113
+ const linkRef = l . getAttribute ( 'ref' ) ;
114
+ if (
115
+ linkHref &&
116
+ isStaticResourcesEqual ( linkHref , url ) &&
117
+ linkRef === attrs [ 'ref' ]
118
+ ) {
114
119
link = l ;
115
120
needAttach = false ;
116
121
break ;
You can’t perform that action at this time.
0 commit comments