From fdb781bc3619a099d9e0dd1eae090c09f1d91184 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:36:32 -0500 Subject: [PATCH] fix(@angular/build): use consistent path separators for template HMR identifiers To ensure that component HMR identifiers match correctly during an update, the path element of the identifier generated by the build system will now convert all windows path separators into POSIX separators. This provides matching behavior to the AOT compiler's identifier generation process. --- .../build/src/tools/angular/compilation/aot-compilation.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts b/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts index a807e0ea791d..6618f00d25f4 100644 --- a/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts +++ b/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts @@ -155,6 +155,7 @@ export class AotCompilation extends AngularCompilation { if (relativePath.startsWith('..')) { relativePath = componentFilename; } + relativePath = relativePath.replaceAll('\\', '/'); const updateId = encodeURIComponent( `${host.getCanonicalFileName(relativePath)}@${node.name?.text}`, );