fix(pdf-viewer): use static worker + lazy page rendering
Worker copied to public/ via prebuild script (avoids Vite resolution issues). IntersectionObserver renders only visible pages (+200px ahead) instead of all at once, fixing performance for large PDFs.
This commit is contained in:
parent
199873781b
commit
a74d3a74d3
3 changed files with 97 additions and 50 deletions
|
|
@ -5,6 +5,7 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"prebuild": "cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdf.worker.min.mjs",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue