During development of angular libraries, I build the libraries on-the-fly using the ng build <lib> --watch
. Setup is according to the official Angular docs at: https://angular.io/guide/creating-libraries I am symlinking the libraries into my project with npm link
. My angular 11 project is compiled using the Ivy compiler. My library is using the View Engine compiler. The ng serve
command uses ngcc
to add the Ivy specific extras to the library (the build artifact in dist
)
However, this approach does not work anymore for a new Angular 11 project. Everytime that the library gets rebuilt by the watcher, the application served by ng serve
loses track and needs to be restarted afresh.
I tried downgrading angular to 10.x and sychronized the typescript compiler version in the library and the application project.
Restarting the ng serve
of the project leads to: Tried to overwrite *.component.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
all the time. Only thing that helps in that case is restarting the ng build <lib> --watch
process.
It seems to me that the in-limbo status of Ivy has thoroughly broken the library development experience using npm link
.
Has anyone ideas about what has changed in Angular 11 that causes this problem?