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

"Why is not bundling node_modules a good thing" info not correct? #55

Closed
stevemao opened this issue Sep 26, 2018 · 3 comments
Closed

"Why is not bundling node_modules a good thing" info not correct? #55

stevemao opened this issue Sep 26, 2018 · 3 comments

Comments

@stevemao
Copy link

It goes against the entire npm dependencies management. If you're using Lodash, and the consumer of your library also has the same Lodash dependency, npm makes sure that it will be added only once. But bundling Lodash in your library will actually make it included twice, since npm is no longer managing this dependency.

I'm not sure if this is correct. Webpack will only bundle it once if within the same version range. I think another reason to use this module is some modules might use binary. Some might use unconventional way to load modules. Some might use fs with relative paths.

@dmngu9
Copy link

dmngu9 commented May 13, 2019

Hi steve. Any update?

@stevemao
Copy link
Author

We shouldn't bundle node_modules, but the reason in README is wrong.

@liady
Copy link
Owner

liady commented Jul 12, 2020

Hi, if still relevant - when building a library for npm (or for Node environment), there is actually no need to bundle its dependencies. Since it will run in Node, it can just require its dependencies (without bundling).
The purpose of this library is to allow running Webpack on the source code - while keeping the dependencies unbundled.

@liady liady closed this as completed Jul 12, 2020
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

3 participants