From 2cc40a1f32986979002851bb18fd30d0f461d457 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Thu, 7 Sep 2023 09:46:44 -0400 Subject: [PATCH] docs(angular): document PNPM workaround for ngcc (#19041) Co-authored-by: Daniel Shuy --- .../setup-incremental-builds-angular.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/shared/guides/setup-incremental-builds-angular.md b/docs/shared/guides/setup-incremental-builds-angular.md index 25ee512aee3dc..700e6adc88e3f 100644 --- a/docs/shared/guides/setup-incremental-builds-angular.md +++ b/docs/shared/guides/setup-incremental-builds-angular.md @@ -26,8 +26,25 @@ installation. You can check your `package.json` and make sure you have the follo } ``` -{% callout type="warning" title="ngcc limitations" %} -Please note that `ngcc` doesn’t support `pnpm` ([#32087](https://github.com/angular/angular/issues/32087#issuecomment-523225437) and [#38023](https://github.com/angular/angular/issues/38023#issuecomment-732423078)), so you need to use either `yarn` or `npm`. +{% callout type="warning" title="PNPM support" %} +To use `ngcc` with `pnpm`, set [`node-linker=hoisted` in `.npmrc`](https://pnpm.io/npmrc#node-linker) ([angular/angular#50735](https://github.com/angular/angular/issues/50735)) and explicitly declare `node-gyp-build` in `package.json` ([#16319](https://github.com/nrwl/nx/issues/16319) and [parcel-bundler/watcher#142](https://github.com/parcel-bundler/watcher/issues/142)), e.g. + +```ini {% fileName=".npmrc" %} +node-linker=hoisted +``` + +```jsonc {% fileName="package.json" %} +{ + ... + "devDependencies": { + ... + "node-gyp-build": "4.6.0", + ... + } + ... +} +``` + {% /callout %} ## Use buildable libraries