question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider moving Webpack support to a separate package

See original GitHub issue

I propose moving webpack.js to a separate package. Why?

If someone is instaling pdf.js, while NOT using Webpack, they will see the following warnings:

warning "yourpackage > pdfjs-dist@2.0.305" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0".
warning "yourpackage > pdfjs-dist > worker-loader@1.1.1" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning "yourpackage > pdfjs-dist > worker-loader > schema-utils@0.4.5" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".

By doing so, we could get rid of worker-loader and webpack dependencies, making required download/build time/test time significantly smaller.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:39
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
almothafarcommented, May 23, 2019

Do you really want worker-loader in dependencies?, maybe it should be in devDependencies, that’s why you get another warning if you remove webpack from peers: https://github.com/webpack-contrib/worker-loader/blob/master/package.json#L42

I see it is used here: https://github.com/mozilla/pdfjs-dist/blob/master/webpack.js#L18

This is the first time I see webpack published in distribution, for something should be working in the client side, as webpack as I know working for building the distribution not part of it.

4reactions
nfantonecommented, Jun 6, 2018

I believe the correct solution is outlined here: https://github.com/mozilla/pdf.js/issues/9733. webpack should not be a "peerDependency" at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Splitting - webpack
Let's take a look at how we might split another module from the main bundle: project webpack-demo |- package.json |- package-lock.json |- webpack.config.js ......
Read more >
The CLI moved into a separate package: webpack-cli. What is ...
I was having the same problem after update some dependencies. Check the webpack-dev-server version, I had 3.1.3 and I was getting same error ......
Read more >
Webpack CLI has moved into a separate package. - Treehouse
When I attempt to minify my bundle with either a custom build script or node_modules/.bin/webpack: The execution fails, telling me that the CLI ......
Read more >
Migrating to webpack 5 to improve build time and reduce ...
Webpack migration from v4 to v5 is not just upgrading the webpack version, it's about migrating all the plugins and loaders to their...
Read more >
Getting Started With Webpack - Smashing Magazine
Modules are broken-down parts of your application which you import to perform a specific task or function. Webpack supports modules created ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found