AAE-34470 Ignore content type of fetched pdfjs worker (#10818)

* AAE-34470 Ignore content type of fetched pdfjs worker

* AAE-34470 Fix units

* AAE-34470 Harness instances of pdfjs worker

* AAE-34470 Harness instances of pdfjs worker

* AAE-34470 Clean docs up

* AAE-34470 Synchronize ngOnChanges

* AAE-34470 Flush not tick

* AAE-34470 Revert modern bundle for pdf_viewer.mjs
This commit is contained in:
Wojciech Duda
2025-04-24 17:18:11 +02:00
committed by GitHub
parent 7b67c7cf3a
commit 3d598cd0c2
3 changed files with 56 additions and 28 deletions

View File

@@ -186,10 +186,9 @@ npm install pdfjs-dist
```ts
// PDF.js
require('pdfjs-dist/web/compatibility.js');
const pdfjsLib = require('pdfjs-dist');
pdfjsLib.PDFJS.workerSrc = './pdf.worker.js';
require('pdfjs-dist/web/pdf_viewer.js');
pdfjsLib.PDFJS.workerSrc = './pdf.worker.min.mjs';
require('pdfjs-dist/web/pdf_viewer.mjs');
```
- Update the `plugins` section of the `webpack.common.js` file with the following lines:
@@ -198,8 +197,8 @@ require('pdfjs-dist/web/pdf_viewer.js');
new CopyWebpackPlugin([
...
{
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
to: 'pdf.worker.js'
from: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
to: 'pdf.worker.min.mjs'
}
])
```