Skip to content

Commit

Permalink
fix(angular): remove prod tsconfig for non-publishable lib (#2816)
Browse files Browse the repository at this point in the history
Closes #2765
  • Loading branch information
brandonroberts committed Apr 9, 2020
1 parent 9d20b03 commit 9f0fdac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/angular/src/schematics/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ describe('lib', () => {
).not.toBeDefined();
});

it('should remove tsconfib.lib.prod.json when library is not publishable', async () => {
const tree = await runSchematic(
'lib',
{ name: 'myLib', publishable: false },
appTree
);

const libProdConfig = tree.read('libs/my-lib/tsconfig.lib.prod.json');

expect(libProdConfig).toBeFalsy();
});

it('should update nx.json', async () => {
const tree = await runSchematic(
'lib',
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/schematics/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ function updateProject(options: NormalizedSchema): Rule {
if (!options.publishable) {
host.delete(path.join(options.projectRoot, 'ng-package.json'));
host.delete(path.join(options.projectRoot, 'package.json'));
host.delete(path.join(options.projectRoot, 'tsconfig.lib.prod.json'));
}

host.delete(path.join(options.projectRoot, 'karma.conf.js'));
Expand Down

0 comments on commit 9f0fdac

Please sign in to comment.