svelte-pdfjs
Advanced tools
Comparing version 0.6.2 to 0.6.3
# svelte-pdfjs | ||
## 0.6.3 | ||
### Patch Changes | ||
- feat: only render in ssr | ||
## 0.6.2 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "svelte-pdfjs", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"engines": { | ||
@@ -36,5 +36,8 @@ "node": ">=16.0.0" | ||
"peerDependencies": { | ||
"svelte": "^3.54.0", | ||
"pdfjs-dist": "3.0.279" | ||
"svelte": "^3.54.0" | ||
}, | ||
"dependencies": { | ||
"pdfjs-dist": "3.0.279", | ||
"esm-env": "^1.0.0" | ||
} | ||
} |
@@ -1,6 +0,7 @@ | ||
import { PDFWorker } from 'pdfjs-dist'; | ||
import { BROWSER } from 'esm-env'; | ||
import * as pdfjs from 'pdfjs-dist'; | ||
import { onDestroy, setContext } from 'svelte'; | ||
export function set_pdfjs_context() { | ||
if (!import.meta.env.SSR) { | ||
const worker = new PDFWorker({ | ||
if (BROWSER) { | ||
const worker = new pdfjs.PDFWorker({ | ||
port: new Worker(new URL('pdfjs-dist/build/pdf.worker.min.js', import.meta.url)), | ||
@@ -7,0 +8,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17730
219
3
+ Addedesm-env@^1.0.0
+ Addedpdfjs-dist@3.0.279
+ Addedesm-env@1.1.4(transitive)