Try to re-add the worker-loader package, in pdfjs-dist, using peerDependencies (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.
This commit is contained in:
Jonas Jenwald 2021-01-05 13:06:57 +01:00
parent 67746ac1c0
commit 95f0f3b621

View File

@ -1969,6 +1969,9 @@ function packageBowerJson() {
homepage: DIST_HOMEPAGE,
bugs: DIST_BUGS_URL,
license: DIST_LICENSE,
peerDependencies: {
"worker-loader": "^3.0.7", // Used in `external/dist/webpack.js`.
},
browser: {
canvas: false,
fs: false,