3 ms·
I would love if Node could consume dependencies from archives (even uncompressed, like tar). Those hundreds of thousands of files make certain things slow on W
by jpalomaki 4y ago
I would love if Node could consume dependencies from archives (even uncompressed, like tar).
Those hundreds of thousands of files make certain things slow on Windows and are cause problems if you want to sync stuff betweek computers.
- demurgos 4y agoYarn provides a "Plug'n'Play" mode implementing exactly this behavior. Dependencies are kept as compressed archives and a loader file is generated so Node can read them directly. If you start Node through Yarn (`yarn node main.js`), it automatically passes the correct flags, but you can also do it manually (something like `node -r .pnp.cjs --experimental-loader .pnp.loader.mjs main.js`). Overall I found this mode to work pretty good. I'm using it for a medium-sized Angular (+ TypeScript) project. It also noticeably improves install times. The PnP mode is stricter about dependencies and expects dependencies to be readonly. A couple dependencies may need to be marked as "unplugged" (installed a regular decompressed dependencies) as a workaround. I'd recommend using this mode if you can.