mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
npmHooks.npmInstallHook: ignore bundle deps when calculating files to install
This assumes that downstream users of `buildNpmPackage` would rather our own built `node_modules` be copied to the output rather than only the `bundleDependencies` specified in the `package.json` file. Having the latter behavior seems unexpected and unintuitive, and would not work as installing from an `npm pack` is intended to (since doing that would not do a `rebuild` step on those dependencies and it would skip reifying a full dependency tree).
This commit is contained in:
parent
4d2f3636bc
commit
ae86a507ed
@ -12,7 +12,7 @@ npmInstallHook() {
|
||||
local dest="$packageOut/$(dirname "$file")"
|
||||
mkdir -p "$dest"
|
||||
cp "${npmWorkspace-.}/$file" "$dest"
|
||||
done < <(@jq@ --raw-output '.[0].files | map(.path) | join("\n")' <<< "$(npm_config_cache="$HOME/.npm" npm pack --json --dry-run --loglevel=warn --no-foreground-scripts ${npmWorkspace+--workspace=$npmWorkspace} $npmPackFlags "${npmPackFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}")")
|
||||
done < <(@jq@ --raw-output '.[0].files | map(.path | select(. | startswith("node_modules/") | not)) | join("\n")' <<< "$(npm_config_cache="$HOME/.npm" npm pack --json --dry-run --loglevel=warn --no-foreground-scripts ${npmWorkspace+--workspace=$npmWorkspace} $npmPackFlags "${npmPackFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}")")
|
||||
|
||||
# Based on code from Python's buildPythonPackage wrap.sh script, for
|
||||
# supporting both the case when makeWrapperArgs is an array and a
|
||||
|
Loading…
Reference in New Issue
Block a user