-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update webpack example #12815
Update webpack example #12815
Conversation
Once the next PDF.js release is made, the `webpack` example will no longer work since the non-translated builds now use ECMAScript features not supported by older `webpack`-versions.
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 also not really familiar with the concept of peer dependencies, but this suggestion has been made before, so I'm going to assume that this is correct. Did you check that this doesn't re-introduce #9248 for example?
…Dependencies` (PR 11474 follow-up) There's been a number of (somewhat) recent issues where people are having trouble using pdfjs-dist together with `webpack`, since that library purposely doesn't declare any dependencies; refer to PR 11474 for additional context. In an *attempt*, although I don't know how much this will actually help in practice (given my limited `webpack` experience), let's try to list `worker-loader` as a *peer*-dependency to see if that helps. This should, unless I'm completely misunderstanding https://docs.npmjs.com/cli/v6/configuring-npm/package-json#peerdependencies, prevent `worker-loader` from being installed by default for *all* pdfjs-dist users while still indicating the dependency for those who need it.
af29f0a
to
95f0f3b
Compare
I'm honestly not entirely sure how to do test this locally, unfortunately! |
@Snuffleupagus I was going to create a PR for #12813 but then I saw this PR, which is related to my issue, should I wait for this PR to be merged to create mine? |
As far as I can tell, you're not going to touch the same files and consequently there shouldn't be any conflicts (not that those are difficult to resolve anyway); hence I don't really see why you'd need to wait :-) |
Thank you! |
Update the webpack-versions used in
examples/webpack
Once the next PDF.js release is made, the
webpack
example will no longer work since the non-translated builds now use ECMAScript features not supported by olderwebpack
-versions.Try to re-add the
worker-loader
package, in pdfjs-dist, usingpeerDependencies
(PR 11474 follow-up)There's been a number of (somewhat) recent issues where people are having trouble using pdfjs-dist together with
webpack
, since that library purposely doesn't declare any dependencies; refer to PR [api-minor] Remove the Webpack-only npm dependencies frompdfjs-dist
(PR 11418 follow-up) #11474 for additional context.In an attempt, although I don't know how much this will actually help in practice (given my limited
webpack
experience), let's try to listworker-loader
as a peer-dependency to see if that helps. This should, unless I'm completely misunderstanding https://docs.npmjs.com/cli/v6/configuring-npm/package-json#peerdependencies, preventworker-loader
from being installed by default for all pdfjs-dist users while still indicating the dependency for those who need it.