Skip to content

Commit ac7caa4

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): ensure unique internal identifiers for inline stylesheet bundling
Within the application builder's template stylesheet processing, internal identifiers are used to track the incremental bundling status of each inline stylesheet. This identifier now consists of the stylesheet language, data, and containing file. This ensures that a tracking entry is maintained for each inline stylesheet and allows for the full cleanup and any incremental bundling resources at the end of the build.
1 parent c12f98f commit ac7caa4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ export class ComponentStylesheetBundler {
6464
// to the actual stylesheet file path.
6565
// TODO: Consider xxhash instead for hashing
6666
const id = createHash('sha256').update(data).digest('hex');
67+
const entry = [language, id, filename].join(';');
6768

68-
const bundlerContext = this.#inlineContexts.getOrCreate(id, () => {
69+
const bundlerContext = this.#inlineContexts.getOrCreate(entry, () => {
6970
const namespace = 'angular:styles/component';
70-
const entry = [language, id, filename].join(';');
71-
7271
const buildOptions = createStylesheetBundleOptions(this.options, this.cache, {
7372
[entry]: data,
7473
});

0 commit comments

Comments
 (0)