Skip to content

Commit

Permalink
Remove the require from the web/pdfjs.js
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Snuffleupagus committed Jul 16, 2023
1 parent 86a8681 commit bad4bff
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions web/pdfjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit bad4bff

Please sign in to comment.