Here is the case. I am using Nrwl NX Monorepo. I have 2 libraries lib-a and lib-b both are publishable libraries created via NX. Now I create a MyClass.ts in lib-a. Naturally under paths in workspace/tsconfig.json paths NX creates an alias to this lib-a ("@workspace/lib-a": ["libs/lib-a/src/index.ts"]). So far so good. Now we can use this class anywhere within the workspace/monorepo by importing it "import { MyClass } from '@workspace/lib-a';
Unfortunately we can not build lib-b which is importing MyClass. When we try to do it we get the bellow error. So question is how can we build lib-b ?
PS It seems strange that NX monorepo actually don't support such a common scenario linking 2 publishable libs.
"error TS6059: File "d:/workspace/libs/lib-a/src/index.ts" is not under 'rootDir' "d:workspacelibslib-bsrc" rootDir is expected to contain all source files"
I have a workaround if you want but it includes building libs in the correct order and making pushing through a lot of extra configuration to ngc.
Duplicate of #602
I have a workaround if you want but it includes building libs in the correct order and making pushing through a lot of extra configuration to ngc.
Hi @criskrzysiu, can you provide some demo repo/project with 2 publisahble libraries.
I think the paths should point to build output, not the source files, like the Angular CLI does by default
Hi, sorry about this.
This was mislabeled as stale. We are testing ways to mark _not reproducible_ issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 馃檹
Most helpful comment
I have a workaround if you want but it includes building libs in the correct order and making pushing through a lot of extra configuration to ngc.