RyanCavanaugh / learn-a

Sample repo using lerna with TypeScript project references

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module not found.

ccorcos opened this issue · comments

In pkg2, I'm getting [ts] Cannot find module '@ryancavanaugh/pkg1'. unless I run tsc -b packages. This is a little annoying... I suppose you aren't supposed to work on both packages at the same time? Or just use --watch to constantly rebuild...

Also, would be nice if I could import specific files from these packages... Should I import directly from the "@ryancavanaugh/pkg1/src/*'?

This example is based on Lerna, do you know how it works? You have to do only 3 steps from the root directory:

  1. yarn install
  2. yarn bootstrap
  3. yarn build

or for DEV mode
yarn dev

No need to build each pkg[n] directly as you maybe doing it.. After that 3 steps you can easily import @ryancavanaugh/pkg1 or @ryancavanaugh/pkg2 or @ryancavanaugh/pkg3

Hello Inside pkg3 I'm getting Cannot find module '@ryancavanaugh/pkg2'. How to fix it? Inside index.ts from pkg1 & pkg2 everything is good.

https://github.com/Izhaki/mono.ts

I believe it does what you're after.