Update webpack import instructions

This resolves an issue I had when loading pdf.js with webpack. `pdfjsLib` was always `undefined` after the import, and I dug deep into pdf.js's `webpack.js` file to sort out this issue, making all sorts of changes.

I figured out that there was just something wrong with the export/import procedure. After making this change, I now have the full pdfjs object in my webpack application.
This commit is contained in:
nikolas 2021-05-28 20:46:56 -04:00 committed by GitHub
parent a0ce3cb3b4
commit 4902f9a54a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,6 @@ Webpack users. You will need to install
dependency in your project in order to use `pdfjs-dist/webpack` (configuring
`worker-loader` is not necessary; just installing it is sufficient).
import pdfjsLib from 'pdfjs-dist/webpack';
import * as pdfjsLib from 'pdfjs-dist/webpack';
For a full working example refer to [this repository](https://github.com/yurydelendik/pdfjs-react).