I'm using a monorepo with nx, with the following structure:
apps
| - my-app
libs
| - common
| - my-client
The libs are being published on npm after the deployment under the names of @my-org/my-client and @my-org/common, while I'm defining the following path alias (on tsconfig.conf) to use them directly on my-app code:
"paths": {
"@my-org/my-client": ["libs/my-client/src/index.ts"],
"@my-org/common": ["libs/common/src/index.ts"]
}
The issue is that my-app is using an external package another-external-package that depends on @my-org/common (it's importing with its published version).
When I import @my-org/common on my-app, it seems that it's picking up the peer dependency @my-org/common (from another-external-package) and not from the alias that is defined on tsconfig.conf.
This happens only when we build for production but not in the dev environment.
Any idea on how to tell nx/tsc to pick the library instead of the published package?