feat(examples): add dev
live reload task to example-with-angular
#10716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I think it's a conventional development workflow to launch both the Angular app (ie,
web
anddocs
) and watch for changes in theui
module. However, the current example'swatch
andstart
tasks (which frontng build
andng serve
) don't seem to work "as expected".By default,
persistent
tasks in Turborepo run at the same time; however, theng serve
in the web app will fail (and doesn't "self-heal"), because theng build
command in the ui package hasn't finished generating thedist
.I first tried all the various configurations I could find to try and get the web app
ng serve
to properly recognize changes in the@repo/ui
package and "self-heal" after the first run, for example, usingpath
configurations intsconfig.json
, etc, but nothing seemed to work (I may be not doing it properly, as I'm not super-familiar with Angular)I then tried some turbo.json configs, trying to use
interruptible
,turbo watch
etc. However, there was still a problem with the first run failing.sleep
before EVERYdev
task that has dependencies would soon run out of runway, so really, properly recognizing changes and "restarting" the task would be the appropriate way of doing it :/angular.json
to re-establish the "self-healing" of theng serve
that we'd see in a non-Turborepo setupTesting Instructions
Running
turbo run dev
orturbo run dev --filter=...@repo/ui
willng build --watch
the@repo/ui
library, and serve theweb
app atlocalhost:4200
.Make changes to the
@repo/ui
library and the app should rebuild and display the changes.