Skip to content

Commit fca46e2

Browse files
committed
fix: use url syntax for webpack
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent ae43fc7 commit fca46e2

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)