Skip to content

Commit 5ea9ce3

Browse files
committed
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. (cherry picked from commit 8875998)
1 parent 544d139 commit 5ea9ce3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export class AotCompilation extends AngularCompilation {
139139
if (relativePath.startsWith('..')) {
140140
relativePath = componentFilename;
141141
}
142+
relativePath = relativePath.replaceAll('\\', '/');
142143
const updateId = encodeURIComponent(
143144
`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`,
144145
);

0 commit comments

Comments
 (0)