4 ms·
In browser land, the less code you ship, the better. Removing dead js code is hard, because of its dynamic nature and using common js imports making it harder f
by rk06 5y ago
In browser land, the less code you ship, the better. Removing dead js code is hard, because of its dynamic nature and using common js imports making it harder for treeshaking algorithms.
So, people had incentive to write and use smaller packages.
Now, the situation has improved. If you use esmodules all the way, and only import what you need, then your bundler can remove unused modules from final build
- herbst 5y ago> In browser land, the less code you ship, the better That's kinda funny. These node tools I run into these days usually take forever to install, waste a lot of space due to creating their own package mirror and generally are prone to break because of dependencies. There is usually nothing tiny about them, even thought they only have a few lines of code.
- kavaruka 5y agousually the "node_modules" folder (with tons of files) is not deployed on production, for front-end application that are going to run in the browser when we make a build for the browser we bundle all dependencies into fewer files that only contain the code that is used