Skip to content

Commit f7f5f5b

Browse files
alan-agius4Keen Yee Liau
authored andcommitted
fix(@schematics/angular): handle existence of un-referenced library prod tsconfig
1 parent 78b408f commit f7f5f5b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/schematics/angular/migrations/update-9/ivy-libraries.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,7 @@ function createTsConfig(tree: Tree, tsConfigPath: string) {
114114
},
115115
};
116116

117-
tree.create(tsConfigPath, JSON.stringify(tsConfigContent, undefined, 2));
117+
if (!tree.exists(tsConfigPath)) {
118+
tree.create(tsConfigPath, JSON.stringify(tsConfigContent, undefined, 2));
119+
}
118120
}

packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ describe('Migration to version 9', () => {
5959
tree,
6060
)
6161
.toPromise();
62+
63+
tree.delete(libProdTsConfig);
6264
});
6365

6466
it(`should add 'tsConfig' option in production when configurations doesn't exists`, async () => {

0 commit comments

Comments
 (0)