mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
fix: respect BASE_PATH in AI chat fetch and pdfjs worker assets
This commit is contained in:
@@ -395,7 +395,11 @@ self.addEventListener(
|
||||
// the default DOMFilterFactory crashes in a worker calling document.createElementNS.
|
||||
// Resolve CMap/standard-font URLs against the worker's own origin. Vite copies these
|
||||
// directories from pdfjs-dist at build time via viteStaticCopy (see vite.config.ts).
|
||||
const assetsBase = new URL("/pdfjs/", self.location.origin).toString();
|
||||
// import.meta.env.BASE_URL ends with a slash and includes any subpath prefix.
|
||||
const assetsBase = new URL(
|
||||
`${import.meta.env.BASE_URL}pdfjs/`,
|
||||
self.location.origin,
|
||||
).toString();
|
||||
const loaderOpts = (data: ArrayBuffer) =>
|
||||
({
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user