File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('PRODUCTION')) {
2121 var pdfjsLib ;
2222 // The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
2323 if ( typeof __pdfjsdev_webpack__ === 'undefined' ) {
24- if ( typeof require === 'function' ) {
25- pdfjsLib = require ( '../build/pdf.js' ) ; // using a bundler to pull the core
24+ if ( typeof window !== 'undefined' && window [ 'pdfjs-dist/build/pdf' ] ) {
25+ pdfjsLib = window [ 'pdfjs-dist/build/pdf' ] ;
26+ } else if ( typeof require === 'function' ) {
27+ pdfjsLib = require ( '../build/pdf.js' ) ;
2628 } else {
27- pdfjsLib = window [ 'pdfjs-dist/build/pdf' ] ; // loaded via html script tag
29+ throw new Error ( 'Neither `require` nor `window` found' ) ;
2830 }
2931 }
3032 module . exports = pdfjsLib ;
You can’t perform that action at this time.
0 commit comments