In our current project build i do install Webviewer through NPM and include the node_modules/@pdftron/webviewer/public
in the project during the build process.
This increases the project size considerably with approximately 60MB.
I read the article Optimize & reduce lib folder for WebViewer. But when trying to run this script it failed due to the fact that it could not find the lib
folder. This folder seems anly to be available in the download packaged and not when installing through npm.
When changing the lib
folder in the optimize script to public
the optimization fails on because the file PDFNet.prod.js
was not available. Although the optimize script is available in the npm packaged, it seems that it is not adapted to work properly when running from the npm package.
Because the build is automated the interactive optimization script is also not really usable.
I can use the download version, run a manual optimization, and than include the optimized version as an asset in the project. This is not a desirable option because this will increase the repository size substantially.
Is there a supported way, or at least documented how to optimize the lib folder manually. So i can use npm and during the build phase remove redundant files from webviewer/lib
folder ?
Cheers,
Peter