Watch Dependencies and rebuild
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
The “ng build --watch” is not rebuilding when a dependency is rebuilt (another angular library).
We have a setup in which we have 2 libraries (Shared and Product) and 1 Angular project.
Shared library is used by both Angular and Product Library. It is shared from local dist.
package.json of library:
{
"name": "product-lib",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^8.1.3",
"@angular/core": "^8.1.3"
},
"dependencies": {
"shared-lib":"file:../shared-proj/dist/shared-lib"
}
}
package.json of Angular Project:
{
"dependencies": {
"shared-lib":"file:../shared-proj/dist/shared-lib"
}
}
We try to do simultaneous development among the 3.
- ng build --watch (shared-lib)
- ng build --watch (product-lib)
- ng serve (Angular)
On any change in the shared-lib the watch is initiated and the library is built. Angular realizes that the library got rebuilt and it rebuilds itself with the library changes. But product-lib is not able to detect the changes in its dependencies.
To make this work we have to stop the watch, “npm install” again and then start the watch.
How To Reproduce
Explained Above.
Expected Behaviour
The watch should also detect changes in dependencies and reinstall dep & rebuild itself similar to how Angular does it.
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 10.0.4
@angular/compiler: 8.2.14
rollup: 2.24.0
tsickle: 0.35.0
typescript: 3.4.5
node: 12.7.0
npm: 6.10.0
If this is already supported please let me know how to.
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top GitHub Comments
So for Angular 11 it was working: When I changed my symlinked library the main app did rebuild correctly. Now with Angular 12 the main app rebuilds but changes are not applied. I tried partial enableIvy: true/false and compilationMode: “partial”
So with Angular 12 I always have to restart my app which is “kind of” annoying.
@alan-agius4 Maybe you have an idea why the behavior changed with Angular 12?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.