Skip to content

Commit

Permalink
fix(@angular/build): use consistent path separators for template HMR …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
clydin committed Dec 11, 2024
1 parent 544d139 commit 5ea9ce3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class AotCompilation extends AngularCompilation {
if (relativePath.startsWith('..')) {
relativePath = componentFilename;
}
relativePath = relativePath.replaceAll('\\', '/');
const updateId = encodeURIComponent(
`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`,
);
Expand Down

0 comments on commit 5ea9ce3

Please sign in to comment.