From bd2e667700ab4433a3374a54db1ece895571cdb5 Mon Sep 17 00:00:00 2001 From: Juri Date: Thu, 9 Apr 2020 12:50:07 +0200 Subject: [PATCH] fix(angular): adjust generated tsconfig path mapping for publishable libraries ISSUES CLOSED: #2794 --- packages/angular/src/schematics/library/library.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/angular/src/schematics/library/library.ts b/packages/angular/src/schematics/library/library.ts index c7a07d793c665..d98db4ce2c685 100644 --- a/packages/angular/src/schematics/library/library.ts +++ b/packages/angular/src/schematics/library/library.ts @@ -406,9 +406,12 @@ function updateTsConfig(options: NormalizedSchema): Rule { return updateJsonInTree('tsconfig.json', json => { const c = json.compilerOptions; delete c.paths[options.name]; - c.paths[`@${nxJson.npmScope}/${options.projectDirectory}`] = [ - `libs/${options.projectDirectory}/src/index.ts` - ]; + + const pathName = options.publishable + ? `@${nxJson.npmScope}/${options.name}` + : `@${nxJson.npmScope}/${options.projectDirectory}`; + + c.paths[pathName] = [`libs/${options.projectDirectory}/src/index.ts`]; return json; })(host, context); }