From fd330a63c96f309c99b18eaaa893bb603518746a Mon Sep 17 00:00:00 2001 From: "Terence D. Honles" Date: Fri, 2 Jul 2021 19:31:01 -0700 Subject: [PATCH] fix(@angular-devkit/build-angular): ensure `NG_PERSISTENT_BUILD_CACHE` 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 --- .../angular_devkit/build_angular/src/webpack/configs/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/configs/common.ts b/packages/angular_devkit/build_angular/src/webpack/configs/common.ts index 8a0013d93632..31c5a20f6471 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/common.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/common.ts @@ -532,7 +532,7 @@ function getCacheSettings( .update(JSON.stringify(wco.tsConfig)) .update(JSON.stringify(wco.buildOptions)) .update(supportedBrowsers.join('')) - .digest('base64'), + .digest('hex'), }; }