Open isti115 opened 4 weeks ago
Why is minification not benficial in Node?
Thank you for considering my suggestion! While minified code might still have some minimal runtime advantages due to optimization heuristics, (even though the node
team seems to be moving away from this approach, e.g. disabling function length based inlining), in my opinion the main benefit to be had is in the reduced bandwidth usage, and thus improved load times when serving web content, which doesn't apply here. Also, even if would be talking about a library that gets used in web pages, I'm of the opinion that minification should be left as a last step to the author of the application itself, not the library. (Or in case of a library that doesn't have to be bundled and can be included from a CDN separately, I think it's the best practice to provide a regular build as well as a minified version ending in .min.js
, as many of the widely used libraries do.)
the main benefit to be had is in the reduced bandwidth usage, and thus improved load times when serving web content, which doesn't apply here
It does. The package needs to be downloaded. And since it gets stored to disk long-term, size probably matters more.
There seems to be little need for minification, as this is a
node
based project never intended to be run in browsers. My reason to get rid of it would be to enable the usage of tools likepatch-package
on the library, which operate on the distributed source, and is practically incompatible withtsx
in its current state.