Skip to content

Commit b87b843

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): remove unneeded package version from inline font cache key
Since the calculated cache path already contains the `@angular-devkit/build-angular` package version, the version is not needed within the cache key for each font URL. This removes the need to import the loaded version from the `package.json` in the font inline logic.
1 parent e308008 commit b87b843

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/angular_devkit/build_angular/src/utils/index-file/inline-fonts.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import { createHash } from 'node:crypto';
1111
import { readFile, rm, writeFile } from 'node:fs/promises';
1212
import * as https from 'node:https';
1313
import { join } from 'node:path';
14-
import { URL } from 'node:url';
1514
import { NormalizedCachedOptions } from '../normalize-cache';
16-
import { VERSION } from '../package-version';
1715
import { htmlRewritingStream } from './html-rewriting-stream';
1816

1917
interface FontProviderDetails {
@@ -173,7 +171,7 @@ export class InlineFontsProcessor {
173171
private async getResponse(url: URL): Promise<string> {
174172
let cacheFile;
175173
if (this.cachePath) {
176-
const key = createHash(CONTENT_HASH_ALGORITHM).update(`${VERSION}|${url}`).digest('hex');
174+
const key = createHash(CONTENT_HASH_ALGORITHM).update(`${url}`).digest('hex');
177175
cacheFile = join(this.cachePath, key);
178176
}
179177

0 commit comments

Comments
 (0)