I'm using pdf.js in an angular project. Building with gulp in production mode works fine, but the production build produces non-working code that fails silently without and warnings or errors, whatsoever. I never get a viewer canvas.
Asked
Active
Viewed 701 times
1 Answers
2
It turns out the problem lies not with minification, but rather with concatenation. The dist directory of the pdfjs-dist bower package contains three files:
- pdf.js
- pdf.worker.js
- pdf.combined.js
the bower.json
file list pdf.js
and pdf.worker.js
, but when using gulp bower copy and concatenation you should use pdf.combined.js
instead of the other two. Add an override to your projects bower.json
"overrides": {
"pdfjs-dist": {
"main": [
"build/pdf.combined.js"
]
}
}

leisurelarry
- 353
- 2
- 12