The cache field is responsible for declaring what parts of your project directory you'd like to cache on disk for subsequent runs. For example, in a typical react application, you may want to cache the contents of .yarn/cache .

Cache Structure

The cache directive accepts a list of entries, each of which has a path field and file field, like so:

- file:
path: foo-path/
- file:
path: bar-path/

Cache Behavior

For the foo example above, Reploy will create a cache entry which points to foo-path on the first run, and only when changes will Reploy invalidate the cache.

In summary, the file field is used for cache validation, and the path tells Reploy where to look for the contents of your cache.


For yarn :

- file: yarn.lock
path: node_modules
build: yarn install --frozen-lockfile --production --prefer-offline