Skip to content

Commit

Permalink
use only modern pdf worker for pdfjs lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rinej committed Dec 17, 2024
1 parent 9fe5511 commit 8a17bd7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
// We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later.
// 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.
{
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
type: 'asset/source',
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/PDFThumbnail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'core-js/proposals/promise-with-resolvers';
// eslint-disable-next-line import/extensions
import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
import pdfWorkerSource from 'pdfjs-dist/build/pdf.worker.min.mjs';
import React, {useMemo, useState} from 'react';
import {View} from 'react-native';
import {Document, pdfjs, Thumbnail} from 'react-pdf';
Expand Down
2 changes: 1 addition & 1 deletion src/types/modules/pdf.worker.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
declare module 'pdfjs-dist/build/pdf.worker.min.mjs';

0 comments on commit 8a17bd7

Please sign in to comment.