26 ms·
I'm not sure if this is the _main_ reason, but one thing that makes node_modules size more than an aesthetic concern is serverless. Booting a serverless functi
by draaglom 4y ago
I'm not sure if this is the _main_ reason, but one thing that makes node_modules size more than an aesthetic concern is serverless.
Booting a serverless function with 100s of mbs of modules takes an appreciable time - to the point where some folks webpack bundle their serverless code
- deleted 4y ago[deleted]
- 14u2c 4y agoAre people actually downloading dependencies on the fly like this? IMO a bundler is absolutely essential. What if npm is down? What if the version of a dependency has been deleted for some reason? These are surprises you absolutely do not want when a function is starting.
- djbusby 4y agoOr left-pad or that other one. JS ecosystem seems dangerous to no version pin, pack and maybe self-host the needed+known-good modules
- Aeolun 4y agoYou don’t download the modules when your function starts. You include 500mb of dependencies in your 50kb lambda function. The difference in boot time between 50kb and 500mb is quite significant.
- pragmatic 4y agoIs this a thing? A buddy started at a new place and he was noticing webpack bundling for the backend. Makes sense when you think about it I guess. Only used bundlers for front end stuff.
- adamparsons 4y agoIf backend services are written in TS (instead of JS) then you'll need to compile to run it. Be that TSC or webpack with ts-loader, you'll need something to perform that step. I don't think anyone is running ts-node outside of local dev environments.
- geoffmanning 4y agoI'm just now finding that webpack is mostly a foreign concept in backend nodejs tech, but it's mind boggling to me that the norm was to ship code with the node_modules folder instead of bundling and minifying. Seriously, why? It's so wasteful... :'(
- ttty 4y agoI just bundle everything except binary dependencies. Faster deployments
- qudat 4y agoIf you want typescript on the BE then you at least need a build step.