This is a public package published to the NPM registry.
A task runner for Nx that uses a Google Cloud Storage bucket as a remote cache, so all team members and CI servers can share a single cache. The concept and benefits of computation caching are explained in the NX documentation.
yarn install --save-dev @zackarydev/nx-remotecache-gcs
Create a Google Cloud Storage bucket. Since this is only a cache, there is no need for a dual- or multi-region bucket, so choose a single location near you.
You may also setup a lifecycle rule for the bucket to automatically delete old files. A suggested 30 day period seems to work well.
Your Google Cloud user must be connected using the gcloud
CLI. Make sure the user has access to the bucket.
Add this runner as the default task runner, ex:
finally, add tasksRunnerOptions in your nx.json file
{
"tasksRunnerOptions": {
"default": {
"runner": "@zackarydev/nx-remotecache-gcs",
"options": {
"bucketName": "gs://NAME_OF_YOUR_BUCKET"
}
}
},
}
- Note that these options may change with new releases of Nx.
- Make changes to files within this project's directory.
-
cd
to this project's directory (tools/nx-remotecache-gcs
) - Run
yarn build
- Run
yarn release
when ready (orcd dist
followed bynpm publish
)