Open jzillmann opened 3 years ago
Right now following pieces are in place:
snowpack.config.js
mount: { ... 'node_modules/pdfjs-dist/es5/build/': { url: '/worker', static: true }, },
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.
npm run build
node_modules/pdfjs-dist/build/pdf.worker.min.js
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...
I guess current setup fixes #28
Right now following pieces are in place:
snowpack.config.js
ui/src/store.js
This works in dev mode, but for a production deployment (
npm run build
) one has to copynode_modules/pdfjs-dist/build/pdf.worker.min.js
toworker/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...