Rebuilding or serving library project
Feature Request
Some interface that would rebuild library project that is generated with ng g library niceLib.
Of Course the best option would be ng serve niceLib or include it to the application serve. Or at least another build that allow to add --watch parameter like it does for for application. Here what I mean:
- for application we are allowed to run
ng build --watch - for library we have
ng build niceLib - but we can't use
ng build niceLib --watch, as it throwsUnknown option: '--watch'
@rdhelms
The point is you are pointing to the library source, not the library output folder. That way ng serve works with source typescript files.
However I think this is good only for development. For prod environment I have the libraries built separately in npm feed and using them as any other 3rd party dependency.
Does it answer your question?
I came back to this, as it has been a while since I tried the whole "double watch" solution, and it could have improved on ng7. Not at all. It is still much slower than running everything as a single project. I have just updated my whole project and deps to version 7 and I can say it is better than before, but still to slow. I hope a solution eventually comes up, until then I will keep using the tsconfig path remap.
@GeorgeKnap you just saved me a few hours a day probably! Can't thank you enough.
@GeorgeKnap I guess your solution stopped working on Angular 8.2.0-next.0 (Ivy enabled) 😐 I'm getting an error:
ERROR in ENOENT: no such file or directory, scandir '/[...]/projects/lib/src/public_api'
This can of course be just a bug on the Angular-side but I couldn't find any according issue.
Update: I fixed it by changing the paths definition in tsconfig.json to "lib/*": [ "projects/lib/src/*" ] and changing all imports to import ... from 'lib/public_api'.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.