From 9243e45df5719c8648f65e5070e24950fc4c3f4a Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Mon, 17 Apr 2023 21:56:15 +0200 Subject: [PATCH] Revert "Import pdfjs-dist directly" This reverts commit ac85a4ee5c9f6ee251c4309ac9774f8d3533de25. --- src/Document.tsx | 2 +- src/Page/AnnotationLayer.tsx | 2 +- src/Page/PageCanvas.tsx | 2 +- src/Page/PageSVG.tsx | 2 +- src/Page/TextLayer.tsx | 2 +- src/index.parcel.ts | 2 +- src/index.parcel2.ts | 2 +- src/index.test.ts | 2 +- src/index.ts | 2 +- src/index.vite.ts | 2 +- src/index.webpack.ts | 2 +- src/index.webpack5.ts | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Document.tsx b/src/Document.tsx index d97b50966..2f6abf6f8 100644 --- a/src/Document.tsx +++ b/src/Document.tsx @@ -15,7 +15,7 @@ import makeCancellable from 'make-cancellable-promise'; import clsx from 'clsx'; import invariant from 'tiny-invariant'; import warning from 'tiny-warning'; -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import DocumentContext from './DocumentContext'; diff --git a/src/Page/AnnotationLayer.tsx b/src/Page/AnnotationLayer.tsx index 31e6ed531..5ae2783af 100644 --- a/src/Page/AnnotationLayer.tsx +++ b/src/Page/AnnotationLayer.tsx @@ -2,7 +2,7 @@ import React, { useContext, useEffect, useMemo, useRef } from 'react'; import makeCancellable from 'make-cancellable-promise'; import invariant from 'tiny-invariant'; import warning from 'tiny-warning'; -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import DocumentContext from '../DocumentContext'; import PageContext from '../PageContext'; diff --git a/src/Page/PageCanvas.tsx b/src/Page/PageCanvas.tsx index 462694bb5..f4d4f1299 100644 --- a/src/Page/PageCanvas.tsx +++ b/src/Page/PageCanvas.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef } from 'reac import mergeRefs from 'merge-refs'; import invariant from 'tiny-invariant'; import warning from 'tiny-warning'; -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import PageContext from '../PageContext'; diff --git a/src/Page/PageSVG.tsx b/src/Page/PageSVG.tsx index 2142d703b..c27399b08 100644 --- a/src/Page/PageSVG.tsx +++ b/src/Page/PageSVG.tsx @@ -2,7 +2,7 @@ import React, { useContext, useEffect, useMemo } from 'react'; import makeCancellable from 'make-cancellable-promise'; import invariant from 'tiny-invariant'; import warning from 'tiny-warning'; -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import PageContext from '../PageContext'; diff --git a/src/Page/TextLayer.tsx b/src/Page/TextLayer.tsx index 8121bd9b5..16cad4a5a 100644 --- a/src/Page/TextLayer.tsx +++ b/src/Page/TextLayer.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, us import makeCancellable from 'make-cancellable-promise'; import invariant from 'tiny-invariant'; import warning from 'tiny-warning'; -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import PageContext from '../PageContext'; diff --git a/src/index.parcel.ts b/src/index.parcel.ts index a2a9fc932..6ba1e00a5 100644 --- a/src/index.parcel.ts +++ b/src/index.parcel.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline'; diff --git a/src/index.parcel2.ts b/src/index.parcel2.ts index 4adcb023c..d0792143d 100644 --- a/src/index.parcel2.ts +++ b/src/index.parcel2.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline'; diff --git a/src/index.test.ts b/src/index.test.ts index 35ded88a1..33c180975 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline'; diff --git a/src/index.ts b/src/index.ts index 3d1944f0d..352957fde 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline'; diff --git a/src/index.vite.ts b/src/index.vite.ts index d127b5a81..75dd06759 100644 --- a/src/index.vite.ts +++ b/src/index.vite.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline'; diff --git a/src/index.webpack.ts b/src/index.webpack.ts index ca0a14af4..8a6069fd6 100644 --- a/src/index.webpack.ts +++ b/src/index.webpack.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/ban-ts-comment, import/no-unresolved */ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; // @ts-ignore-next-line import pdfjsWorker from 'file-loader!pdfjs-dist/build/pdf.worker'; diff --git a/src/index.webpack5.ts b/src/index.webpack5.ts index d127b5a81..75dd06759 100644 --- a/src/index.webpack5.ts +++ b/src/index.webpack5.ts @@ -1,4 +1,4 @@ -import pdfjs from 'pdfjs-dist'; +import * as pdfjs from 'pdfjs-dist'; import Document from './Document'; import Outline from './Outline';