Explanation of why the pdf.min.js file comes to my browser when I open pdf using react-pdf #1561
-
One question @wojtekmaj, Can you give me a explanation for it? How a node_modules file is getting opened up in the browser because our server has the node_modules not our browser. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Can't say without seeing your setup in detail. pdf.js file is a dependency module like any other, so it will be included in your bundle. Depending on your configuration, it may or may not be packed with other modules your app depends on. What you're looking at may also be a result of source maps work, showing you actual source files without them actually being there in unchanged form. pdf.worker.js is the one that's special - worker file needs to be a separate, static file, untouched by bundlers. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Well because you're supposed to. PDFs are rendered off the main thread if possible. All good.