Skip to content

Commit 168ef39

Browse files
authored
fix(@angular/build): refresh template diagnostics on Windows after an external template changes
On Windows the modified files are normalized to backslash paths while component resource dependencies use forward slashes, so the lookup never matched and the cached Angular diagnostics of the component were kept.
1 parent 853f83a commit 168ef39

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/angular/build/src/tools/angular/compilation/aot-compilation.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import type * as ng from '@angular/compiler-cli';
1010
import assert from 'node:assert';
11-
import { relative } from 'node:path';
11+
import { normalize, relative } from 'node:path';
1212
import ts from 'typescript';
1313
import { useTypeChecking } from '../../../utils/environment-options';
1414
import { profileAsync, profileSync } from '../../../utils/profiling';
@@ -331,7 +331,8 @@ export class AotCompilation extends TypeScriptCompilation {
331331
if (this.#state && hostOptions.modifiedFiles?.size) {
332332
for (const resourceDependency of resourceDependencies) {
333333
if (
334-
!hostOptions.modifiedFiles.has(resourceDependency) ||
334+
(!hostOptions.modifiedFiles.has(resourceDependency) &&
335+
!hostOptions.modifiedFiles.has(normalize(resourceDependency))) ||
335336
/\.(?:css|scss|sass|less)$/i.test(resourceDependency)
336337
) {
337338
continue;

0 commit comments

Comments
 (0)