From 39aa62732d39d418daa1b9d50ce57cb419693434 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 2 Jan 2020 20:37:09 +0100 Subject: [PATCH] fix(@angular-devkit/build-angular): account for hashed and non hashed filesnames when having sourcemaps --- .../angular_devkit/build_angular/src/browser/action-cache.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/browser/action-cache.ts b/packages/angular_devkit/build_angular/src/browser/action-cache.ts index ee6e40027156..fea96134c7a5 100644 --- a/packages/angular_devkit/build_angular/src/browser/action-cache.ts +++ b/packages/angular_devkit/build_angular/src/browser/action-cache.ts @@ -76,7 +76,8 @@ export class BundleActionCache { // sourceMappingURL is added at the very end which causes the code to be the same when sourcemaps are enabled/disabled // When using hiddenSourceMaps we can omit the postfix since sourceMappingURL will not be added. - const sourceMapPostFix = action.sourceMaps && !action.hiddenSourceMaps ? '|sourcemap' : ''; + // When having sourcemaps a hashed file and non hashed file can have the same content. But the sourceMappingURL will differ. + const sourceMapPostFix = action.sourceMaps && !action.hiddenSourceMaps ? `|sourcemap|${action.filename}` : ''; const baseCacheKey = this.generateBaseCacheKey(action.code);