buildNpmPackage: allow passing npmDeps

authored by

happysalada and committed by
Yt
7fb49067 54f00576

+6 -6
+1
doc/languages-frameworks/javascript.section.md
··· 210 210 * `npmPruneFlags`: Flags to pass to `npm prune`. Defaults to the value of `npmInstallFlags`. 211 211 * `makeWrapperArgs`: Flags to pass to `makeWrapper`, added to executable calling the generated `.js` with `node` as an interpreter. These scripts are defined in `package.json`. 212 212 * `nodejs`: The `nodejs` package to build against, using the corresponding `npm` shipped with that version of `node`. Defaults to `pkgs.nodejs`. 213 + * `npmDeps`: The dependencies used to build the npm package. Especially useful to not have to recompute workspace depedencies. 213 214 214 215 #### prefetch-npm-deps {#javascript-buildNpmPackage-prefetch-npm-deps} 215 216
+5 -6
pkgs/build-support/node/build-npm-package/default.nix
··· 35 35 # Value for npm `--workspace` flag and directory in which the files to be installed are found. 36 36 , npmWorkspace ? null 37 37 , nodejs ? topLevelArgs.nodejs 38 + , npmDeps ? fetchNpmDeps { 39 + inherit forceGitDeps src srcs sourceRoot prePatch patches postPatch; 40 + name = "${name}-npm-deps"; 41 + hash = npmDepsHash; 42 + } 38 43 , ... 39 44 } @ args: 40 45 41 46 let 42 - npmDeps = fetchNpmDeps { 43 - inherit forceGitDeps src srcs sourceRoot prePatch patches postPatch; 44 - name = "${name}-npm-deps"; 45 - hash = npmDepsHash; 46 - }; 47 - 48 47 # .override {} negates splicing, so we need to use buildPackages explicitly 49 48 npmHooks = buildPackages.npmHooks.override { 50 49 inherit nodejs;