News for hackers. Stuff that matters.
Re:Size of node_modules folder when installing the top 100 p... by whostolemyhat on Friday January 10, 2020 @04:22AM (#22009614)
That's because there's no point including an entire library if you only need a few functions. It means that your deployed bundle is much smaller, which means that users don't need to download unused code and waste time/bandwidth (ie a good thing).

Tree shaking still isn't that great or widely available, so separate packages mean you can do this manually.

Re:Size of node_modules folder when installing the top 100 p... by filleduchaos on Friday January 10, 2020 @07:04AM (#22010386)
> Tree shaking still isn't that great or widely available

This sounds like an opinion based on the state of web development a decade ago.

In 2020 on the other hand the Google Closure Compiler has been a mature project for years, and even projects not explicitly focused on dead code elimination (bundlers like Webpack and Rollup) do a decently thorough job of cutting out unnecessary code with the right plugins.

Re:Size of node_modules folder when installing the top 100 p... by fhennig on Friday January 10, 2020 @06:47AM (#22010318)
If there is a set of standard libraries, wouldn't they be cached in the browser anyways?