(React Native) Cache dependencies (node_modules)
DescriptionClick to copy link
Set up caching for dependencies (node_modules folder) of a React Native app.
InstructionsClick to copy link
-
Add the **Bitrise.io Cache:Pull**Step.
-
Add either the Run yarn command or the Run npm command Step to your Workflow 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 variable to
install. - Set Cache node_modules to
yes.
- Set the The yarn command to run or The npm command with arguments to run input variable to
-
Add the Bitrise.io Cache:Push Step.
-
(Optional) Set the Compress cache input variable to
true. This can be useful if your cache folders are large and you are experiencing slow build times.
bitrise.ymlClick to copy link
Using yarn:
- cache-pull@2: {}
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: install
- cache-push@2:
inputs:
- compress_archive: 'true'
Using npm:
- cache-pull@2: {}
- npm@1:
inputs:
- cache_local_deps: 'yes'
- command: install
- cache-push@2:
inputs:
- compress_archive: 'true'