I have made my first library, using the new angular-cli command: library.
After I build the library I wanted to import it into an existing project (without publishing to npm), but unfortunately without luck.. Actually, it works if I copy it into node_modules, but then I would have to do that every time I update my node_modules folder. Therefore I would like to have a folder (libs) in the root directory where I can store and reference all my (homemade) libraries.
I tried by making the folder and pasting the library into it, and added the paths options in tsconfig. Which results in a "cannot find module" error (I guess I am missing something in the cli setup, but I cannot figure out what)
Do you know what I am missing? Or do you have another approach to this scenario?
Thanks :)
EDIT:
tsconfig.json:
{
"compilerOptions": {
// code omitted for brevity
"paths": {
"my-lib": ["./libs/my-lib"],
}
}
import in app.module.ts
import { MyLibraryModule } from 'my-lib'