diff --git a/doc/hooks/index.md b/doc/hooks/index.md index 6a16b4e65170..2cd155ccf173 100644 --- a/doc/hooks/index.md +++ b/doc/hooks/index.md @@ -29,6 +29,7 @@ mpi-check-hook.section.md ninja.section.md npm-build-hook.section.md npm-config-hook.section.md +npm-install-hook.section.md patch-rc-path-hooks.section.md perl.section.md pkg-config.section.md diff --git a/doc/hooks/npm-install-hook.section.md b/doc/hooks/npm-install-hook.section.md new file mode 100644 index 000000000000..f099aec13b4a --- /dev/null +++ b/doc/hooks/npm-install-hook.section.md @@ -0,0 +1,35 @@ +# npmHooks.npmInstallHook {#npm-install-hook} + +Hook to install node_modules for npm packages. +Does not create wrappers for executable npm projects +Primarily made for a multi-language environment. + +## Examples {#npm-install-hook-snippet} + +[](#npm-build-hook-example-snippet) + +## Variables controlling `npmInstallHook` {#npm-install-hook-variables} + +### `npmInstallHook` Exclusive Variables {#npm-install-hook-exclusive-variables} + +#### `dontNpmPrune` {#npm-install-hook-dont-prune} + +Whether to run {command}`npm prune` on the `node_modules` or not. +Defaults to `true`. + +#### `npmInstallFlags` {#npm-install-hook-prune-flags} + +Flags to pass to the {command}`npm prune` call for the `node_modules` of the package. +Defaults to `--omit=dev --no-save` which cannot be modified. + +#### `dontNpmInstall` {#npm-install-hook-dont} + +Controls whether `npmInstallHook` is enabled or not. +Defaults to `true`, so the hook will run. + +### Honored Variables {#npm-install-hook-honored-variables} + +The following variables are honored by the `npmInstallHook`. + +- [`npmWorkspace`](#javascript-buildNpmPackage-npmWorkspace) +- [`npmFlags`](#javascript-buildNpmPackage-npmFlags) diff --git a/doc/redirects.json b/doc/redirects.json index 16aea31242aa..498b60182b6b 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -260,6 +260,30 @@ "npm-config-hook-writable-cache": [ "index.html#npm-config-hook-writable-cache" ], + "npm-install-hook": [ + "index.html#npm-install-hook" + ], + "npm-install-hook-dont": [ + "index.html#npm-install-hook-dont" + ], + "npm-install-hook-dont-prune": [ + "index.html#npm-install-hook-dont-prune" + ], + "npm-install-hook-exclusive-variables": [ + "index.html#npm-install-hook-exclusive-variables" + ], + "npm-install-hook-honored-variables": [ + "index.html#npm-install-hook-honored-variables" + ], + "npm-install-hook-prune-flags": [ + "index.html#npm-install-hook-prune-flags" + ], + "npm-install-hook-snippet": [ + "index.html#npm-install-hook-snippet" + ], + "npm-install-hook-variables": [ + "index.html#npm-install-hook-variables" + ], "pkgs-replacevars": [ "index.html#pkgs-replacevars", "index.html#pkgs-substituteall",