diff --git a/packages/schematics/angular/migrations/update-9/ivy-libraries.ts b/packages/schematics/angular/migrations/update-9/ivy-libraries.ts index a88f19946cf5..5d9fe6a0a560 100644 --- a/packages/schematics/angular/migrations/update-9/ivy-libraries.ts +++ b/packages/schematics/angular/migrations/update-9/ivy-libraries.ts @@ -114,5 +114,7 @@ function createTsConfig(tree: Tree, tsConfigPath: string) { }, }; - tree.create(tsConfigPath, JSON.stringify(tsConfigContent, undefined, 2)); + if (!tree.exists(tsConfigPath)) { + tree.create(tsConfigPath, JSON.stringify(tsConfigContent, undefined, 2)); + } } diff --git a/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts b/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts index ecb42748b501..bd7ba0d0aea1 100644 --- a/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts +++ b/packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts @@ -59,6 +59,8 @@ describe('Migration to version 9', () => { tree, ) .toPromise(); + + tree.delete(libProdTsConfig); }); it(`should add 'tsConfig' option in production when configurations doesn't exists`, async () => {