-
Notifications
You must be signed in to change notification settings - Fork 12k
Rebuilding or serving library project #10643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The new What I'm doing is using my When serving the app, any file changes inside |
Heya, this feature request is something we are aware of and talk about in https://github.com/angular/angular-cli/wiki/stories-create-library#why-do-i-need-to-build-the-library-everytime-i-make-changes.
|
As a workaround you can use
It's on the slow side but does get the job done. One downside is that you need to run a separate process for each of the libs you want to rebuild. |
try |
The proposal from @Tyler-V is by far the only acceptable at this moment. No developer can take the productivity hit that manually rebuilding the library causes. Even with an automated watcher the build time increases substantially. Until there is a fix I, differently from what the ng team proposes, will err on the side of productivity instead of caution. |
@filipesilva and @alan-agius4 worked on some changes this morning and I'm currently able to serve my library from my demo project as suggested and build all in --aot! You can view the changes here, specifically the PR by filipesilva https://github.com/Tyler-V/ngx-easy I believe changes were committed and merged on ng-packagr to support this. |
BTW, to anyone interested, it is easier to, instead of using When there is an acceptable fix simply change this one line back to |
@Tyler-V That is awesome, but with what dependency and tools versions? |
I'm using all @latest packages with the proper scoped lib configurations as suggested by @filipesilva You can use my project as a reference on how I am serving my demo to develop the libraries with refresh. |
@giggio I also use that way 🐱. With projects do have UI. It's really paintful to rebuild library and re-run everytime we do have a change 😢 |
@hansl how is this going to work and in what version of the CLI should we expect it? Is it 6.1.0 as per the milestone? |
@giggio, you can read the documentation here: https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/create-library.md#why-do-i-need-to-build-the-library-everytime-i-make-changes In a nutshell you'd need to run ng build my-lib --watch This will do a partial recompilation of the library, if you want to rebuild also the app when the library changes, you'd need to spawn 2 processed. One that watches the library and another that watches the application. As far as the release, this won't be under |
I've been using the
now the libraries are built by |
@alan-agius4 we have a repo with 6 angular projects inside. Are there already plans on solving If I watch Something like |
@filipesilva how would you handle project with multiple library dependencies?
|
@playground the CLI at the moment does not rebuild project dependencies at all. You have to manually build those libraries in separate processes, and you probably want to keep them in watch mode so the libraries are rebuilt. |
On my machine rebuilding the library in a separate process triggers the rebuild of the main app too early and the resulting library code in the app is always one change behind. The solution by @GeorgeKnap works, though. |
@GeorgeKnap 's suggestion works! |
@GeorgeKnap you're a lifesaver! Thanks 🎉 |
Wow...so that really does work eerily well...do you know what the downsides are of using the |
@rdhelms 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. |
@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) 😐
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 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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:ng build --watch
ng build niceLib
ng build niceLib --watch
, as it throwsUnknown option: '--watch'
The text was updated successfully, but these errors were encountered: