diff --git a/src/material/schematics/ng-update/index.ts b/src/material/schematics/ng-update/index.ts index 18644fe90a00..b76c9f98966b 100644 --- a/src/material/schematics/ng-update/index.ts +++ b/src/material/schematics/ng-update/index.ts @@ -59,7 +59,9 @@ function renameMdcTokens(): Rule { if (shouldRenameTokens(path)) { const content = tree.readText(path); const updatedContent = content.replace('--mdc-', '--mat-'); - tree.overwrite(path, updatedContent); + if (content !== updatedContent) { + tree.overwrite(path, updatedContent); + } } }); };