Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api-minor] Tweak the Node.js fake worker loader to prevent `Critical…
… dependency: ...` warnings from Webpack Since bundlers, such as Webpack, cannot be told to leave `require` statements alone we are thus forced to jump through hoops in order to prevent these warnings in third-party deployments of the PDF.js library; please see [Webpack issue 8826](https://github.com/webpack/webpack) and libraries such as [require-fool-webpack](https://github.com/sindresorhus/require-fool-webpack). *Please note:* This is based on the assumption that code running in Node.js won't ever be affected by e.g. Content Security Policies that prevent use of `eval`. If that ever occurs, we should revert to a normal `require` statement and simply document the Webpack warnings instead.
- Loading branch information
d370037
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When can we see this in a new build? Because we are just getting the issue like i explained here. mikecousins/react-pdf-js#186
d370037
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's tracked in #11495.
d370037
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using
rollup
as bundler in my project and it throws a warning thateval
is strongly discouraged. This holds me back from upgrading to the latest version ofpdf.js
, I don't want to suppress theeval
warning over my whole project.It has been a while since this was implemented, and I saw that the issue that is referenced in the code is closed (without solution/work around as I understand). Is there a work around/something else that can be done here to avoid the use of
eval
?