starter icon indicating copy to clipboard operation
starter copied to clipboard

External worker dependency (for Next.js)

Open dmudro opened this issue 3 years ago • 6 comments

The Next.js starter suggest an external dependency on the pdf worker:

...
<Worker workerUrl="https://unpkg.com/[email protected]/build/pdf.worker.js">
...

Since we already have the worker file in node_modules/pdfjs-dist it would be more feasible to use the local file and avoid the external http call and to improve the integrity of pdfjs-dist version in the first place.

Any ideas what's the best approach here?

I appreciate this might not be directly related to the pdf viewer code base as such. Perhaps a separate webpack bundle with the worker could do the job here.

dmudro avatar Sep 14 '21 08:09 dmudro