Skip to content

Commit fdb781b

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 0d2c648 commit fdb781b

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

Lines changed: 1 addition & 0 deletions
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)