From 4902f9a54a8aaec13b840febb7bc6e4b102f83df Mon Sep 17 00:00:00 2001 From: nikolas Date: Fri, 28 May 2021 20:46:56 -0400 Subject: [PATCH] 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. --- examples/webpack/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webpack/README.md b/examples/webpack/README.md index c7ebd3b0a..0ea1aaed9 100644 --- a/examples/webpack/README.md +++ b/examples/webpack/README.md @@ -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).