I have a lerna + yarn workspaces monorepo, with independent versioning. I'm having trouble importing a package in its sibling.
I have two packages, one of which should depend on the other, as illustrated below:
(root)
|--packages
|--money
|--money-standard-units
|--{deps. on money}
Inside of money-standard-deps
, I try to import an exported member of money
but I'm unable to do so; I get the following message:
TS2307: Cannot find module 'money' or its corresponding type declarations.
I know this issue can be resolved by adding money
to the paths
array of money-standard-libs
's tsconfig, but I want to depend on the built package as these will be published seperately. I want this to effectively work as-if it's two seperate repos.
I've created a demo repo.
@somescope
but maybe changingexport * from './monetary-unit';
toexport { MonetaryUnit } from './monetary-unit';
in money/src/index.ts – Shcherbakov"dependencies": { "@somescope/money": "^0.0.0" }
will not resolve. – Shcherbakovimport
statements in themoney-standard-units
package wont resolve. I get the error mentioned in the question. – Sybilexport { MonetaryUnit } from './monetary-unit';
did not work? – Shcherbakov