From 4ef8addd3f2b588c1e07cb4ffe5db8eea6455e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Wed, 13 Jul 2022 12:27:53 +0100 Subject: [PATCH] fix(angular): do not write files unnecessarily in mfe to mf migration --- .../src/migrations/update-14-5-0/migrate-mfe-to-mf.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts index 4c5f41bf96226..ce27504ee2558 100644 --- a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts +++ b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts @@ -127,15 +127,16 @@ export default async function (tree: Tree) { visitNotIgnoredFiles(tree, '/', (path) => { const pathExtName = extname(path); - let fileContents = tree.read(path, 'utf-8'); - if (pathExtName === '.ts' || pathExtName === '.js') { - fileContents = replaceNrwlAngularMfImport(fileContents); + if (pathExtName !== '.ts' && pathExtName !== '.js') { + return; } + let fileContents = tree.read(path, 'utf-8'); + fileContents = replaceNrwlAngularMfImport(fileContents); + if (pathExtName === '.ts') { // Only TS files can import types and interfaces fileContents = replaceExportedMFETypes(fileContents); - fileContents = renameSetupMfeGeneratorUsages(fileContents); }