I have 2 different angular apps and both of them will need to use a lot of the same services and interfaces, so I created added a third separate project and created a library there with some services and interfaces. After building the library I added the following to one of the 2 apps
package.json:
"daleeli-lib": "file:../SharedServices/dist/my-lib",
The problem with this is if I change the folder name of one of the files I will get an error as the library is no longer referenced:
Cannot find module 'my-lib' or its corresponding type declarations.
Is there a workaround to this without uploading the library to NPM?
CodePudding user response:
You can use npm link like well explained in this link. https://medium.com/angular-in-depth/complete-beginner-guide-to-publish-an-angular-library-to-npm-d42343801660
or you can build your lib in locale and do a npm package. Import this pakage in your web app, and do an npm install 'yorfilepath'