1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Load the fake worker, in non-PRODUCTION mode, with native async import

This removes the last SystemJS usage from both the API and the default viewer.
This commit is contained in:
Jonas Jenwald 2020-10-25 14:42:46 +01:00
parent 126f42a266
commit d9084c0be2
2 changed files with 2 additions and 12 deletions

View file

@ -2026,12 +2026,7 @@ async function loadFakeWorker() {
GlobalWorkerOptions.workerSrc = AppOptions.get("workerSrc");
}
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
if (typeof SystemJS !== "object") {
// Manually load SystemJS, since it's only necessary for fake workers.
await loadScript("../node_modules/systemjs/dist/system.js");
await loadScript("../systemjs.config.js");
}
window.pdfjsWorker = await SystemJS.import("pdfjs/core/worker.js");
window.pdfjsWorker = await import("pdfjs/core/worker.js");
return undefined;
}
return loadScript(PDFWorker.getWorkerSrc());