Skip to content

Commit ca4453f

Browse files
authored
Replace pdfjs-dist build with legacy ES5 version (#794)
1 parent a129be0 commit ca4453f

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/Document.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
66
import makeEventProps from 'make-event-props';
77
import makeCancellable from 'make-cancellable-promise';
88
import mergeClassNames from 'merge-class-names';
9-
import * as pdfjs from 'pdfjs-dist';
9+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
1010

1111
import DocumentContext from './DocumentContext';
1212

src/Page/AnnotationLayer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
3-
import * as pdfjs from 'pdfjs-dist';
3+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
44
import makeCancellable from 'make-cancellable-promise';
55

66
import DocumentContext from '../DocumentContext';

src/Page/PageSVG.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
3-
import * as pdfjs from 'pdfjs-dist';
3+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
44

55
import PageContext from '../PageContext';
66

src/entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as pdfjs from 'pdfjs-dist';
1+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
22

33
import Document from './Document';
44
import Outline from './Outline';

src/entry.parcel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as pdfjs from 'pdfjs-dist';
1+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
22

33
import Document from './Document';
44
import Outline from './Outline';

src/entry.webpack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as pdfjs from 'pdfjs-dist';
1+
import * as pdfjs from 'pdfjs-dist/legacy/build/pdf';
22
// eslint-disable-next-line
3-
import pdfjsWorker from 'file-loader!pdfjs-dist/build/pdf.worker';
3+
import pdfjsWorker from 'file-loader!pdfjs-dist/legacy/build/pdf.worker';
44

55
import Document from './Document';
66
import Outline from './Outline';

src/pdf.worker.entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
* See: https://github.com/parcel-bundler/parcel/issues/670
88
*/
99

10-
(typeof window !== 'undefined' ? window : {}).pdfjsWorker = require('pdfjs-dist/build/pdf.worker.js');
10+
(typeof window !== 'undefined' ? window : {}).pdfjsWorker = require('pdfjs-dist/legacy/build/pdf.worker');

0 commit comments

Comments
 (0)