I have two repositories in TypeScript, one project and one library. Both of them have a src directory where all TypeScript files are committed.
I already have npm up and running in the project with the library as a dependency.
I can do from a .ts file in my project's src directory
import { Foo } from "@vendor/my-lib/src/Foo";
As you can see there is this annoying src directory in the import. Ideally a project should be unaware about the internals of a library, e.g import { Foo } from "@vendor/my-lib/Foo";
Can this be solved?Best would be if the library's tsconfig.json could contain the configuration so that all consumers of the library uses it the same way.
But if that is not possible, the projects tsconfig.json will suffice.
Any hints? Quite hard to find any solid up-to-date documentation for this.
https://www.typescriptlang.org/docs/handbook/module-resolution.html