ng2-pdfjs-viewer
ng2-pdfjs-viewer copied to clipboard
using minified files
Hi @petebacondarwin and @anthonybriand!
I hope everything is going well with you!
Please, could you clarify the following doubt (?):
- Please could you verify the use Use minified versions of pdfjs *.js dependencies #22 in a production release?
Best regards
I'm not sure why you linked me into this issue?
I'm not sure why you linked me into this issue?
Hi @petebacondarwin! Sorry! I marked you because GitHub showed your username. I thought you were a contributor to the project.
Instead of using the provided file, try the below:
Copy the node_modules\ng2-pdfjs-viewer\pdfjs
to a place like assets\pdfjs
(Already assets folder and no need to config angular.json)
Edit the assets\pdfjs\web\view.html
file to use the *.min.js
(or replace with some CDN?)
Edit assets\pdfjs\web\viewer.min.js
value:"../build/pdf.worker.js"
with ../build/pdf.worker.min.js
of course
And, require("../build/pdf.js")
Delete extra files
-
assets\pdfjs\build
, only keep*.min.js
-
assets\pdfjs\web
, only keep*.min.js
(viewer.min.js
) -
assets\pdfjs\web\locale
, can keeplocale.properties
anden-US
This should reduce the build/load significantly: