heroku-buildpack-nodejs
heroku-buildpack-nodejs copied to clipboard
Build cache not consistent with globs
Copied from a support ticket:
Our node app contains the following lines in the package.json:
"cacheDirectories": [
"node_modules",
"browser/node_modules",
"node/*/node_modules"
],
As you can see, we use a glob to specify which folder need to be cached. At the end of the build process we see what we expect:
Clearing previous node cache
Saving N cacheDirectories (package.json):
- node_modules
- browser/node_modules
- node/foo/node_modules
- node/bar/node_modules
- node/baz/node_modules
But when the build starts, and the cached directory are loaded, where is what we see:
│remote: -----> Restoring cache
│remote: Loading 3 from cacheDirectories (package.json):
│remote: - node_modules
│remote: - browser/node_modules
│remote: - node/*/node_modules (not cached - skipping)
We would expect that the same strategy is applied when restoring the cache (using glob matching in the cached directory).