Given a monorepo project. --project_root/ |--packageA/ |--index.ts |--package.json |--foo/ |--index.ts |--packageB/ |--index.ts |--package.json |--bar/ |--spam.ts Normally, when you are in packageA/index.ts and you want to import packageB/index.ts you would do import index from '../packageB',
and when you are packageA/foo/index.ts and you want to import packageB/index.ts you need to move two directory up import index from '../../packageB'
The question is, is there a way to import like import index from 'packageB and for nested folder import spam from 'packageB/bar/spam'?
EDIT
I have uploaded a github repo to demo the issue https://github.com/jaimesangcap/lerna-ts-monorepo