Repository navigation
Conversation
`npmInstallHook` currently performs a prune step to remove unnecessary dependencies from node_modules. This behavior makes more sense as the `fixupPhase`, filling a similar role to stripping binary files.
doronbehar
left a comment
There was a problem hiding this comment.
I'm not sure about this, due to what I wrote below, and also because overriding the fixup phase seems wrong. Additionally, I was thinking of this option when I wrote my last comment in #328544 and I decided not to suggest it, because the official stdenv fixup docs state:
The fixup phase performs (Nix-specific) post-processing actions on the files installed under $out by the install phase.
|
|
||
| find node_modules -maxdepth 1 -type d -empty -delete | ||
|
|
||
| cp -r node_modules "$nodeModulesPath" |
There was a problem hiding this comment.
Hmm this is a bit worrying - The installPhase will run before the fixupPhase, and will copy this directory before the fixup happened.. Then, if you won't run npm prune, you will always get all of the development dependencies in the $packageOut/node_modules... That's probably the reason why the author of this hook saw this part as an nondetachable part of the installation phase.
npmInstallHookcurrently performs a prune step to remove unnecessary dependencies from node_modules.This behavior makes more sense as the
fixupPhase, filling a similar role to stripping binary files.Description of changes
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.