From 6876ad36efaadac5c4d371cff96c9a4cfa0e3d2b Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 10 Jan 2022 12:51:21 +0100 Subject: [PATCH] fix(@angular-devkit/build-angular): use `contenthash` instead of `chunkhash` for chunks See https://github.com/waysact/webpack-subresource-integrity/tree/main/webpack-subresource-integrity#caching and https://github.com/waysact/webpack-subresource-integrity/issues/162 for more information about this. Closes #22439 (cherry picked from commit 11f817adae4f06d8b80a9d74534468f6e3c2d2c5) --- .../angular_devkit/build_angular/src/webpack/utils/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/utils/helpers.ts b/packages/angular_devkit/build_angular/src/webpack/utils/helpers.ts index 4944cb0d0c4d..ab0f78250a5d 100644 --- a/packages/angular_devkit/build_angular/src/webpack/utils/helpers.ts +++ b/packages/angular_devkit/build_angular/src/webpack/utils/helpers.ts @@ -32,13 +32,13 @@ export function getOutputHashFormat(option: string, length = 20): HashFormat { none: { chunk: '', extract: '', file: '', script: '' }, media: { chunk: '', extract: '', file: `.[hash:${length}]`, script: '' }, bundles: { - chunk: `.[chunkhash:${length}]`, + chunk: `.[contenthash:${length}]`, extract: `.[contenthash:${length}]`, file: '', script: `.[hash:${length}]`, }, all: { - chunk: `.[chunkhash:${length}]`, + chunk: `.[contenthash:${length}]`, extract: `.[contenthash:${length}]`, file: `.[hash:${length}]`, script: `.[hash:${length}]`,