1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Ensure that the viewer waits for the library to complete loading (issue 17228)

This should *hopefully* fix 17228, by tweaking the build scripts to give the GENERIC viewer something to await to avoid breaking third-party users of the standalone viewer components.
This commit is contained in:
Jonas Jenwald 2023-11-10 12:49:37 +01:00
parent 1b88aad0db
commit 823d375b8b
2 changed files with 10 additions and 1 deletions

View file

@ -422,7 +422,7 @@ function tweakWebpackOutput(jsName) {
case " __webpack_exports__ = {};":
return ` __webpack_exports__ = globalThis.${jsName} = {};`;
case " __webpack_exports__ = await __webpack_exports__;":
return ` __webpack_exports__ = globalThis.${jsName} = await __webpack_exports__;`;
return ` __webpack_exports__ = globalThis.${jsName} = await (globalThis.${jsName}Promise = __webpack_exports__);`;
}
return match;
});