You should use npm/yarn's production flags when installing your dependencies for your images, so you only ship runtime dependencies.
Your images will shrink to 100-150mb.
You should use npm/yarn's production flags when installing your dependencies for your images, so you only ship runtime dependencies.
Your images will shrink to 100-150mb.
The issue is that packages often balloon in size from an accidental transitive inclusion of Babel or webpack. Because JS packages depend on so much, the fanout virtually guarantees someone in your dependency tree will accidentally a dependency every now and then. It’s compounded by the fact that I have several different versions of the same package installed because folks don’t use peerDependencies when they should (and I’m afraid to pin most packages because I don’t want to introduce subtle bugs).
I’d imagine I could solve this for us if I had enough time, but startup life leaves little time for battling with the package manager. And it creeps up on you slowly.
(Also: we use next-transpire-modules @martpie, thanks for a great library)
I wonder how much “build maintenance” is/will become a factor in choosing between ecosystems.
Minimizing dependencies and writing as much as possible on your own would probably cut a 500 MB nodejs project to 5 MB in plain JS.
Note: Not a node dev but share the grief...