Skip to content

Commit 6382967

Browse files
authored
Merge pull request #40 from rinej/use-only-modern-pdfjs-dist
Update react-fast-pdf to use modern pdfjs-dist lib
2 parents 3ad08b6 + c311227 commit 6382967

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

example/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = {
4646
// This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server.
4747
{
4848
// eslint-disable-next-line prefer-regex-literals
49-
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),
49+
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
5050
type: 'asset/source',
5151
},
5252
],

src/PDFPreviewer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-expect-error - This line imports a module from 'pdfjs-dist' package which lacks TypeScript typings.
22
// eslint-disable-next-line import/extensions
3-
import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
3+
import pdfWorkerSource from 'pdfjs-dist/build/pdf.worker.min.mjs';
44
import React, {memo, useCallback, useLayoutEffect, useRef, useState} from 'react';
55
import type {CSSProperties, ReactNode} from 'react';
66
import times from 'lodash/times';

0 commit comments

Comments
 (0)