🐛 should trigger scripts loading before them executing (#2389)

This commit is contained in:
Kuitos 2023-02-09 21:58:08 +08:00 committed by GitHub
parent 0a87e4586d
commit 52b1a3c441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,7 +263,9 @@ export async function loadApp<T extends ObjectType>(
} = configuration;
// get the entry html content and script executor
const { template, execScripts, assetPublicPath } = await importEntry(entry, importEntryOpts);
const { template, execScripts, assetPublicPath, getExternalScripts } = await importEntry(entry, importEntryOpts);
// trigger external scripts loading to make sure all assets are ready before execScripts calling
await getExternalScripts();
// as single-spa load and bootstrap new app parallel with other apps unmounting
// (see https://github.com/CanopyTax/single-spa/blob/master/src/navigation/reroute.js#L74)