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

@ -1746,12 +1746,7 @@ const PDFWorker = (function PDFWorkerClosure() {
return mainWorkerMessageHandler;
}
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");
}
const worker = await SystemJS.import("pdfjs/core/worker.js");
const worker = await import("pdfjs/core/worker.js");
return worker.WorkerMessageHandler;
}
if (