From 4c54ad0aea521d0882af8af63b12050a2c849d8b Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 19 Sep 2019 11:13:34 -0400 Subject: [PATCH] refactor(@angular-devkit/build-angular): account for disabled mangling in downlevel cache --- packages/angular_devkit/build_angular/src/browser/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/browser/index.ts b/packages/angular_devkit/build_angular/src/browser/index.ts index 84abd3852729..8d987b12d146 100644 --- a/packages/angular_devkit/build_angular/src/browser/index.ts +++ b/packages/angular_devkit/build_angular/src/browser/index.ts @@ -65,6 +65,7 @@ import { normalizeOptimization, normalizeSourceMaps, } from '../utils'; +import { manglingDisabled } from '../utils/mangle-options'; import { CacheKey, ProcessBundleOptions } from '../utils/process-bundle'; import { assertCompatibleAngularVersion } from '../utils/version'; import { @@ -385,7 +386,10 @@ export function buildWebpackBrowser( const codeHash = createHash('sha1') .update(action.code) .digest('hex'); - const baseCacheKey = `${packageVersion}|${action.code.length}|${codeHash}`; + let baseCacheKey = `${packageVersion}|${action.code.length}|${codeHash}`; + if (manglingDisabled) { + baseCacheKey += '|MD'; + } // Postfix added to sourcemap cache keys when vendor sourcemaps are present // Allows non-destructive caching of both variants