Trying to build a a publishable lib with other libs as dependencies fail.
NX latest version.
Preset: React
I wanna create publishable react libs which has other dependencies (non publishable)


It seems like you'd need to pass --buildable to step 4 and manually add paths yo your publishable library's tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"paths": {
"@test/lib2": ["dist/libs/lib2"]
}
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
Hi there @imcvakt ! Thanks for filing an issue!
Did you try the solution that @MmtBkn provided? I believe it should solve your issue. Let me know if this helps, and I can close this issue!
Hi there @imcvakt ! After talking with some of my colleagues, things cleared a bit.
Right now this is by design. Publishable libs can only depend on other publishable libs.
So, to solve your issue, you can make them both publishable. If you make them both publishable, and then import b into a, then you can run nx build a --with-deps and it will work like a charm (no need to do anything else - no need for any manual editing).
I will close this issue for now, but please reopen if my suggestions did not solve your issue! Thanks again! :)
Sorry for the late response. I will try to check @MmtBkn workaround and I come back with more info... Even after that reply :P @mandarini
Most helpful comment
It seems like you'd need to pass
--buildableto step 4 and manually addpathsyo your publishable library'stsconfig.json{ "extends": "../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "paths": { "@test/lib2": ["dist/libs/lib2"] } }, "files": [], "include": [], "references": [ { "path": "./tsconfig.lib.json" }, { "path": "./tsconfig.spec.json" } ] }