From 1be3b07836659487e4aa9b8c71c673635e268a60 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 13 Jul 2021 17:06:58 +0200 Subject: [PATCH] fix(@angular-devkit/build-angular): exclude `outputPath` from persistent build cache key With this change we exclude `outputPath` from cache key due to i18n extraction which causes it to change on every build https://github.com/angular/angular-cli/blob/736a5f89deaca85f487b78aec9ff66d4118ceb6a/packages/angular_devkit/build_angular/src/utils/i18n-options.ts#L264-L265 Closes #21275 --- .../build_angular/src/webpack/configs/common.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 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 e880c169ce51..84a67d761ea6 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/common.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/common.ts @@ -507,7 +507,14 @@ function getCacheSettings( .update(packageVersion) .update(wco.projectRoot) .update(JSON.stringify(wco.tsConfig)) - .update(JSON.stringify(wco.buildOptions)) + .update( + JSON.stringify({ + ...wco.buildOptions, + // Needed because outputPath changes on every build when using i18n extraction + // https://github.com/angular/angular-cli/blob/736a5f89deaca85f487b78aec9ff66d4118ceb6a/packages/angular_devkit/build_angular/src/utils/i18n-options.ts#L264-L265 + outputPath: undefined, + }), + ) .update(supportedBrowsers.join('')) .digest('hex'), };