4 ms·
You may find something like node2nix helpful (https://github.com/svanderburg/node2nix https://github.com/svanderburg/node2nix). This converts your package.json
by biggestlou 3y ago
You may find something like node2nix helpful (https://github.com/svanderburg/node2nix https://github.com/svanderburg/node2nix). This converts your package.json into a Nix expression that can then be cached. You're right that it does require some setup and a bit of Nix knowledge but could yield significant benefits and take a good chunk out of that 20 minutes.
Another option might be to use pnpm instead of Yarn and cache your pnpm dependencies. pnpm actually works a bit like Nix in that it creates a pnpm-lock.yaml file with content-based hashes for the full package.json dependency tree. This enables it to quickly determine which parts of the dependency tree it needs to build and which are already available.
- soraminazuki 3y agoNowadays, there's buildNpmPackage [1]. It's included in Nixpkgs, actively maintained, and easier to work with IMO. [1]: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#buildnpmpackage-javascript-buildnpmpackage https://github.com/NixOS/nixpkgs/blob/master/doc/languages-f...