Wanting Relative Imports in Typescript is driving me bananas

I am developing in an nx repository. I have a non-buildable library (only one used for importing for app compilation), say ‘@client-apps/core’ and it contains an index.ts such that external uses are expected to be able to import anything necessary from ‘@client-apps/core’; Thus, the path map in the base tsconfig is setup: "@client-apps/core": ["libs/core/src/index.ts"].

Now inside of libs/core/src… any code that is importing other stuff within the library I want to be relative path so it doesn't try to import from the index.ts and potentially cause a circular import. 

But it is only ever offering me imports from ‘@client-apps/core’. 

I have tried to setup the “use path mappings from tsconfig.json” “only in files outside of specified paths” but it doesn't work at all.

The only way I was able to get this thing to offer the correct import AT ALL was to delete the path mapping temporarily. 

Is there something I am missing that might prevent me from going insane?

1 comment
Do you have a sample repo you can share that reproduces the issue?

Please sign in to leave a comment.