File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
packages/runtime/src/utils Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/runtime ' : patch
3
+ ---
4
+
5
+ Ensured createScript runtime hook always receives ` attrs `
Original file line number Diff line number Diff line change @@ -82,9 +82,10 @@ export function preloadAssets(
82
82
getRemoteEntry ( {
83
83
remoteInfo : moduleInfo ,
84
84
remoteEntryExports : module . remoteEntryExports ,
85
- createScriptHook : ( url : string ) => {
85
+ createScriptHook : ( url : string , attrs : any ) => {
86
86
const res = host . loaderHook . lifecycle . createScript . emit ( {
87
87
url,
88
+ attrs,
88
89
} ) ;
89
90
if ( ! res ) return ;
90
91
@@ -108,9 +109,10 @@ export function preloadAssets(
108
109
getRemoteEntry ( {
109
110
remoteInfo : moduleInfo ,
110
111
remoteEntryExports : undefined ,
111
- createScriptHook : ( url : string ) => {
112
+ createScriptHook : ( url : string , attrs : any ) => {
112
113
const res = host . loaderHook . lifecycle . createScript . emit ( {
113
114
url,
115
+ attrs,
114
116
} ) ;
115
117
if ( ! res ) return ;
116
118
@@ -212,9 +214,10 @@ export function preloadAssets(
212
214
fetchpriority : 'high' ,
213
215
type : remoteInfo ?. type === 'module' ? 'module' : 'text/javascript' ,
214
216
} ,
215
- createScriptHook : ( url : string ) => {
217
+ createScriptHook : ( url : string , attrs : any ) => {
216
218
const res = host . loaderHook . lifecycle . createScript . emit ( {
217
219
url,
220
+ attrs,
218
221
} ) ;
219
222
if ( res instanceof HTMLScriptElement ) {
220
223
return res ;
You can’t perform that action at this time.
0 commit comments