5 ms·
The reason is that JavaScript is not compiled and needs the dependency’s source files to run, and those files need to be there when packaged.
by webkike 4y ago
The reason is that JavaScript is not compiled and needs the dependency’s source files to run, and those files need to be there when packaged.
- wging 4y agoThat's not an obstacle to a central cache - you can solve that with symlinks. A build tool should make node_modules/foo a symlink to ~/.npm/cache/foo-1.23 if foo 1.23 is what you need. A packaging tool should be able to follow symlinks easily.
- MBCook 4y agoRight. And Node/Webpack/whatever could easily be taught to read inside zip files instead of needing things unpacked on disk. That’s actually already been done for Yarn PNP support in Webpack.