Skip to content

Commit 8875998

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.
1 parent 12f2026 commit 8875998

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: packages/angular/build/src/tools/angular/compilation/aot-compilation.ts

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export class AotCompilation extends AngularCompilation {
155155
if (relativePath.startsWith('..')) {
156156
relativePath = componentFilename;
157157
}
158+
relativePath = relativePath.replaceAll('\\', '/');
158159
const updateId = encodeURIComponent(
159160
`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`,
160161
);

0 commit comments

Comments
 (0)