Skip to content

Commit

Permalink
Merge pull request #39 from VickyStash/fetaure/update-pdfWorkerSource
Browse files Browse the repository at this point in the history
Update pdfWorkerSource to fix console warnings
  • Loading branch information
tylerkaraszewski authored Nov 27, 2024
2 parents 9170243 + dcb04d0 commit e8366dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
// 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.
{
// eslint-disable-next-line prefer-regex-literals
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.js'),
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),
type: 'asset/source',
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/PDFPreviewer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-expect-error - This line imports a module from 'pdfjs-dist' package which lacks TypeScript typings.
// eslint-disable-next-line import/extensions
import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.mjs';
import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
import React, {memo, useCallback, useLayoutEffect, useRef, useState} from 'react';
import type {CSSProperties, ReactNode} from 'react';
import times from 'lodash/times';
Expand Down

0 comments on commit e8366dc

Please sign in to comment.