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.
This commit is contained in:
Jonas Jenwald 2023-07-15 10:17:26 +02:00
parent 86a868189c
commit bad4bfffdf

View File

@ -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;