'Use Angular library repository as dependency via Bitbucket

I got a problem regarding the use of an Angular library repository. Hopefully find an answer here :)

I have an Angular repository which holds one single Angular library. This library is stored in a bitbucket repository - including the compiled files in the "dist" folder.

Now I want to consume this library by an application.

Currently, when I install the library repository as an dependency to my application (via npm install git+ssh://[email protected]/NAME/my-library.git) the whole repository is added to the node_modules folder of the application.

But with this configuration the library can not be found by the application. Because of the fact, that the compiled library files are located in the "dist" folder of the repository.

Now how can I tell the application to look in the "dist" folder of the library folder, to find the needed library files?

A current workaround is to place the following in the tsconfig.json of my application

"compilerOptions": {
    "paths": {
      "my-library": [ "node_modules/my-library/dist" ]
    }
}

But I'm almost sure, that there must be somethign more generic. Something which must be placed in the package.json/angular.json of the library repository to point consuming applications to the dist-folder?

Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source