From 18b44fd7d24bae2b92c91b8fc6b7b07dce27fa41 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 22 Jun 2026 15:43:59 +0300 Subject: [PATCH] pnpmConfigHook: allow opt-out This is sometimes useful when mixing ecosystems, e.g. in buildGoModule. (cherry picked from commit 8f26ec5602d481a1137ae683165af637bfff2124) --- doc/languages-frameworks/javascript.section.md | 2 ++ pkgs/build-support/node/fetch-pnpm-deps/pnpm-config-hook.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 4e031f7f5f34..0ecb59dd3bb6 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -406,6 +406,8 @@ In case you are patching `package.json` or `pnpm-lock.yaml`, make sure to pass ` } ``` +If needed, `dontPnpmConfigure = true;` can be used to fully disable `pnpmConfigHook` without manually removing it from inputs. + #### Dealing with `sourceRoot` {#javascript-pnpm-sourceRoot} If the pnpm project is in a subdirectory, you can just define `sourceRoot` or `setSourceRoot` for `fetchPnpmDeps`. diff --git a/pkgs/build-support/node/fetch-pnpm-deps/pnpm-config-hook.sh b/pkgs/build-support/node/fetch-pnpm-deps/pnpm-config-hook.sh index dc732c3822f8..52e5a3dbbd53 100644 --- a/pkgs/build-support/node/fetch-pnpm-deps/pnpm-config-hook.sh +++ b/pkgs/build-support/node/fetch-pnpm-deps/pnpm-config-hook.sh @@ -126,4 +126,6 @@ pnpmConfigHook() { echo "Finished pnpmConfigHook" } -postConfigureHooks+=(pnpmConfigHook) +if [ -z "${dontPnpmConfigure-}" ]; then + postConfigureHooks+=(pnpmConfigHook) +fi