Skip to content

Commit c81adbd

Browse files
Alan Agiusmgechev
Alan Agius
authored andcommitted
fix(@schematics/angular): polyfills migration leaving broken code in windows
Replacment of line endings should only happen to increase the hash matches as otherwise the recorder will fail to update the correct positions Fixes #14443
1 parent c402903 commit c81adbd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/schematics/angular/migrations/update-8/drop-es6-polyfills.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ function dropES2015PolyfillsFromFile(polyfillPath: string): Rule {
7878
return;
7979
}
8080

81-
// normalize line endings to increase hash match chances
82-
const content = source.toString().replace(/\r\n|\r/g, '\n');
83-
81+
const content = source.toString();
8482
// Check if file is unmodified, if so then replace and return
8583
const hash = createHash('md5');
86-
hash.update(content);
84+
// normalize line endings to increase hash match chances
85+
hash.update(content.replace(/\r\n|\r/g, '\n'));
8786
const digest = hash.digest('hex');
8887
if (knownPolyfillHashes.includes(digest)) {
8988
// Replace with new project polyfills file

0 commit comments

Comments
 (0)