This commit is contained in:
2026-09-18 22:33:38 +03:00
parent a095cae1b5
commit 673e779bb2
2 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "vite build && cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs dist/pdf.worker.min.mjs",
"preview": "vite preview"
},
"devDependencies": {

View File

@ -1,8 +1,7 @@
import * as pdfjsLib from 'pdfjs-dist';
import workerUrl from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
if (typeof window !== 'undefined') {
pdfjsLib.GlobalWorkerOptions.workerSrc = workerUrl;
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs';
}
/**