- npx create-nx-workspace --pm yarn
- Name the workspace
- Select none for 'stack'
- Select "Package-based monorepo"
- Select "Do It Later"
- Select "No" to remote caching
(In my case here, I also removed the .nx/workspace-data folder from the git ignore so I could trace changes)
- npx nx g @nx/js:lib mylib
- Select "None"
- Select "None"
- Select "As provided"
- Run
yarn nx run-many -t lint
- This populates the local cache
- Run
yarn nx run-many -t lint
again, result is cached - In Finder, delete
mylib/src/index.ts
and then hitcmd+z
to undo - You will see that the
.nx/workspace-data/file-map.json
file changes significantly - Run
yarn nx run-many -t lint
again, result is NOT cached - Repeat the delete, undo and lint run, result is cached again
- Now note that running
yarn nx reset
followed by the lint command will revert the changes that happened to the.nx/workspace-data/file-map.json
in step 5 - Subsequent deletes to not alter the
file-map.json
file now