I'm trying to setup a Monorepo with Lerna and yarn workspaces, but the thing that I cannot get to work is where I try to add packages as a dependency of an other local package
So, what does that mean
I have a project structure like this
/
packages/
a/
src/a.ts
b/
src/b.ts
ab/
src/ab.ts
Very basic, its for testing only. I've also create a public repository with this structure and all the other files in place. You can follow the readme to reproduce the problem.
So, a.ts
looks like this
export class A {
get(): string {
return 'a';
}
}
b.ts
looks very similar and ab.ts
uses both as follows
import { A } from '@myScope/a';
import { A } from '@myScope/b';
export class Ab {
getA(): A {
return new A();
}
getB(): B {
return new B();
}
Now, when I build these with lerna run build
, which is nothing more than tsc
on all three files, I get errors, telling me that the modules imported in ab.ts
cannot be found. So the question is, how can I add my two local packages?