Add version to pdf.js file in webpack builds
What does this MR do and why?
This MR backports the changes from !168419 (merged) to 17-4-stable-ee
.
pdf.js
was upgraded in 17.4
, and we discovered that a cached version of assets/webpack/pdfjs/pdf.worker.min.js
can be served, causing PDF rendering issues.
This backport ensures that PDF rendering works as expected for self-managed instances.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- follow the instructions to run the app in webpack
- run
yarn run clean
to remove the existingpubic/assets
files - run
yarn webpack
, new pdfjs files should be copied underpublic/assets/webpack/pdfjs/3.11.174
- viewing pdf files should work as expected
note, i am not 100% sure if there is a way to see the files being copied, besides running yarn webpack
, which triggers the copy plugin. the source tab in the browser only shows the public output path. however, webpack only runs in gdk for me withOUT the public assets folder. so after the first 3 steps, the public asset needs to be removed to make sure webpack is working again.
Related to #491716 (closed)