Cache the contents of the node_modules
folder with the new key-based caching Steps, Save Cache and Restore Cache.
- Add the Restore NPM Cache Step to the Workflow.
- Add either the Run yarn command Step or the Run npm command Step based on your project setup. Set the input variables:
- Set the The yarn command to run or The npm command with arguments to run input to
install
.
- Set the The yarn command to run or The npm command with arguments to run input to
- Add the Save NPM Cache Step.
The NPM specific cache steps use optimal cache key and path configurations maintained by Bitrise. If you want full control over what should be cached then please check out the generic Restore Cache and Save Cache Steps.
You can always check out what key and path settings the NPM cache step uses: Github code snippet
- restore-npm-cache@2: {}
- npm@1:
inputs:
- command: install
- save-npm-cache@1: {}