- cross-posted to:
- programmer_humor@programming.dev
- cross-posted to:
- programmer_humor@programming.dev
Which is of very little importance in most cases, because modern bundlers incorporate treeshaking in order to filter out all the unused code when you’re building a production application
Edit: okay well appearently that’s controversial for some reason
I didn’t know about treeshaking (still unsure what it is exactly since I’m not a js Dev), but I’m guessing it still takes up Gigs of space in the project folder of every Devs PC, duplicated for each project.
It does take a lot of space for devs, but personally I find that absolutely irrelevant, because it’s your end user’s experience that really matters, and - as a dev - you are most likely to have a much better rig and internet connection than your average Joe.
Sure, in many cases the dev’s computer is powerful enough to handle that.
However:
- The more the dependencies, the more likely it is to pull-off a supply chain attack. Any of those thousands modules can be compromised and infect either the user or the developer.
- Not all computers are optimized for working with so many tiny files. Have you ever worked in a company that uses McAfee Antivirus? Even Defender can be a massive performance hit in some cases.
node_modules might take a lot of space on a dev machine, but as op said, only the files used are packed into web artifacts that are deployed.
So 12gbs can end up as 10mb, arbitrary number to highlight significance of tree shaking.
this assumes the dev is smart enough to do --save-dev
found 7745962577 vulnerabilities (7653345675 low, 91726393 medium, 817263 high, 73246 critical)