Skip to content
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

Peer dependency of required module is not bundled #24

Closed
JakubMatejka opened this issue Jan 23, 2017 · 1 comment
Closed

Peer dependency of required module is not bundled #24

JakubMatejka opened this issue Jan 23, 2017 · 1 comment

Comments

@JakubMatejka
Copy link

Hi, I use request-promise package which has peer dependency on request but only request-promise is bundled and request is missing. I used default nodeExternals() setup and switched to nodeExternals({ modulesFromFile: true }) but it is still the same (althoug I have both request and request-promise in dependencies of my package.json).

So I have to require the request in my code even if I don't use it directly. Have I forgotten to setup something or it is a bug?

@liady
Copy link
Owner

liady commented Mar 5, 2017

@JakubMatejka Just to be clear - do you want to bundle request-promise and request?
webpack-node-externals is meant for not bundling modules if you're targeting Node environment.
If you do want to bundle those modules, you would have to require them, otherwise Webpack won't mark them as dependencies to be added to the bundle.
Peer dependency means that request-promise is meant to be uses aside of request, and is expecting you to have it as a dependency (it is not requiring it directly).
(For example - a jQuery plugin may have a peer dependency of jQuery, so it won't bring jQuery on its own, but expects you to bring it yourself)

Let me know if you need any more assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants