Skip to content

Commit 77b8518

Browse files
authored
Merge pull request #4 from LibreSign/fix/use-url-syntax-for-webpack
fix: use url syntax for webpack
2 parents ae43fc7 + fca46e2 commit 77b8518

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils/asyncReader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// SPDX-License-Identifier: AGPL-3.0-or-later
33

44
import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist'
5-
import pdfWorkerCode from 'pdfjs-dist/build/pdf.worker.min.mjs'
65

7-
GlobalWorkerOptions.workerSrc = pdfWorkerCode
6+
const workerUrl = new URL('pdfjs-dist/build/pdf.worker.min.mjs', import.meta.url).href
7+
GlobalWorkerOptions.workerSrc = workerUrl
88

99
export function readAsArrayBuffer(file) {
1010
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)