From 8f26ec5602d481a1137ae683165af637bfff2124 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. --- 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 7bf9ad661b55..e2ef01141eb9 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -408,6 +408,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 38f6eb97b56b..4a44775ab7b8 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 @@ -118,4 +118,6 @@ pnpmConfigHook() { echo "Finished pnpmConfigHook" } -postConfigureHooks+=(pnpmConfigHook) +if [ -z "${dontPnpmConfigure-}" ]; then + postConfigureHooks+=(pnpmConfigHook) +fi