Closed Matwog closed 2 years ago
Hey @Matwog! I think I see what is going on. Here are the two elements at play:
outputs
property to know where your artifacts are for each script ran. For test (w/o coverage) this is normally none, but for build you are outputting an artifact to disk.Here is the docs on how to specify non-standard outputs: https://nx.dev/configuration/packagejson#project-configuration
Nx supports build artifacts in the following locations by default:
dist/path/to/package/root
path/to/package/root/dist
path/to/package/root/build
path/to/package/root/public
@AgentEnder Thanks for quick response.
Yes specifying non-standard outputs makes sense. I tried it now in the minimal repo and I can see that Nx works and is able to correctly restore the cache. π Will try to integrate the same way for our product.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
First of all, thanks a ton to the authors for the great work with Nx. β€οΈ π We, in our codebase, recently migrated away from
yarn
andlerna
to usingpnpm
and would like to integrateNx
and observed few blockers.Current Behavior
Nx in a monorepo using PNPM workspaces does not restore the correct cache.
Expected Behavior
Nx restores the correct cache.
Steps to Reproduce
pnpm install
at root levelpnpm build-all
.build
folder. Observe the files in thebuild
folder.index.js
file inpackage-one
.pnpm build-all
. Nx triggers a fresh build forpackage-one
but uses the cached version forpackage-two
. πindex.js
file inpackage-one
and runpnpm build-all
.index.js
file inside thebuild
folder. It does not reflect the latest state of the source file.Additional Info: Nx was added to the repo by running
npx add-nx-to-monorepo
.pnpm
. This would be a potential blocker.This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
The above screenshot may be useful.
Environment