Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: Include PDF.js web-worker in a way that works with bundling #23

Open
jzillmann opened this issue Mar 5, 2021 · 1 comment
Open

Comments

@jzillmann
Copy link
Owner

Right now following pieces are in place:

  • In snowpack.config.js
  mount: {
        ...      
        'node_modules/pdfjs-dist/es5/build/': { url: '/worker', static: true },
    },
  • And then in ui/src/store.js
pdfjs.GlobalWorkerOptions.workerSrc = `worker/pdf.worker.min.js`;

This works in dev mode, but for a production deployment (npm run build) one has to copy node_modules/pdfjs-dist/build/pdf.worker.min.js to worker/pdf.worker.min.js.

There has to be a better way!

There is related documentation and conversation:

But i failed so far with any approach...

@jzillmann jzillmann added help wanted project setup Build & Deployment labels Mar 5, 2021
@jzillmann jzillmann added this to the v2 milestone Mar 5, 2021
@jzillmann jzillmann changed the title V2: Include pdfJs web-worker in a way that works with bundling V2: Include PDF.js web-worker in a way that works with bundling Mar 5, 2021
@darkcheftar
Copy link

I guess current setup fixes #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants