Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): ensure `NG_PERSISTENT_BUILD_CACHE…
Browse files Browse the repository at this point in the history
…` always creates a cache in the specified cache directory

This change fixes `NG_PERSISTENT_BUILD_CACHE` sometimes creating cache
entries that live outside of the cache directory by using a hex encoding
rather than a base64 encoding. This error is caused because the base64
alphabet includes `/`. According to the webpack documentation [1] the
default `cacheLocation` is:

  path.resolve(cache.cacheDirectory, cache.name)

Which means cache names with a leading `/` would remove the
`cacheDirectory` altogether.

[1]: https://webpack.js.org/configuration/other-options/#cachecachelocation
  • Loading branch information
alan-agius4 authored and clydin committed Jul 6, 2021
1 parent 0776370 commit a5c6972
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ function getCacheSettings(
.update(JSON.stringify(wco.tsConfig))
.update(JSON.stringify(wco.buildOptions))
.update(supportedBrowsers.join(''))
.digest('base64'),
.digest('hex'),
};
}

Expand Down

0 comments on commit a5c6972

Please sign in to comment.