diff --git a/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts b/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts index b7d7cd6793043..17af41ff8c3ee 100644 --- a/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts +++ b/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts @@ -3,11 +3,15 @@ import { getProjects, updateProjectConfiguration, } from '../../generators/utils/project-configuration'; -import { isRelativePath } from 'nx/src/utils/fileutils'; -import { joinPathFragments } from 'nx/src/utils/path'; +import { isRelativePath } from '../../utils/fileutils'; +import { joinPathFragments } from '../../utils/path'; +import { formatChangedFilesWithPrettierIfAvailable } from '../../generators/internal-utils/format-changed-files-with-prettier-if-available'; export default async function (tree: Tree) { for (const [name, value] of getProjects(tree).entries()) { + if (!value.targets) { + continue; + } for (const t of Object.values(value.targets)) { if (t.outputs) { t.outputs = t.outputs.map((o) => @@ -17,4 +21,5 @@ export default async function (tree: Tree) { } updateProjectConfiguration(tree, name, value); } + await formatChangedFilesWithPrettierIfAvailable(tree); }