From bad4bfffdf4bfc15c66039eb1b8731d86f154dfa Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 15 Jul 2023 10:17:26 +0200 Subject: [PATCH] Remove the `require` from the `web/pdfjs.js` Having a `require` in this file has never made sense in e.g. the Firefox PDF Viewer and shouldn't really be necessary. Possibly the idea was to facilitate some kind of third-party bundling, however the *built* `pdf.js` file has always exposed the API-contents globally. --- web/pdfjs.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/web/pdfjs.js b/web/pdfjs.js index 25f5435c3..f119f2ef4 100644 --- a/web/pdfjs.js +++ b/web/pdfjs.js @@ -12,14 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals module, __non_webpack_require__ */ +/* globals module */ "use strict"; -let pdfjsLib; -if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) { - pdfjsLib = window["pdfjs-dist/build/pdf"]; -} else { - pdfjsLib = __non_webpack_require__("../build/pdf.js"); -} -module.exports = pdfjsLib; +module.exports = globalThis.pdfjsLib;