feat: upgrade pdfjs-dist from 3.x to 5.x for improved PDF viewer

Update worker path from .js to .mjs to match the new ESM-only build
structure in pdfjs-dist v5. Core API (getDocument, getPage, render)
remains compatible.
This commit is contained in:
2026-03-04 15:28:07 +05:30
parent 824f659e13
commit bf67156b9c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -63,7 +63,7 @@
"marked": "^17.0.3",
"marked-highlight": "^2.2.3",
"pdf-lib": "^1.17.1",
"pdfjs-dist": "^3.11.174",
"pdfjs-dist": "^5.5.207",
"pdfkit": "^0.14.0",
"pizzip": "^3.2.0",
"tslib": "^2.8.1",
+1 -1
View File
@@ -4182,7 +4182,7 @@ let isPdfViewerActive = false; // Track if PDF viewer is currently shown
// Initialize PDF.js
const pdfjsLib = require('pdfjs-dist');
pdfjsLib.GlobalWorkerOptions.workerSrc = require.resolve('pdfjs-dist/build/pdf.worker.js');
pdfjsLib.GlobalWorkerOptions.workerSrc = require.resolve('pdfjs-dist/build/pdf.worker.mjs');
// Open PDF file
async function openPdfFile(filePath) {