I'm developing an Angular 10 library within a workspace that holds other applications (that will use that library).
When it comes to build the library and test it on a demo app within the workspace the following things happens:
- when building the library with
ng b --watchand the app withng severything works fine. - when instead I build the library with
ng b --watch --prodand the app withng sthe following errors are thrown by the application:
error NG8001: 'wv-lib-map' is not a known element:
1. If 'wv-lib-map' is an Angular component, then verify that it is part of this module.
2. If 'wv-lib-map' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
This error is repeated for all the components imported from the library by the application.
So my question is: how can I build the library (in prod mode) concurrently with the app, without getting those ugly errors?
If I build in development mode without the --prod flag, the Angular Language Service on VSCode always shows my template elements as unknown (in the application using the library templates), even though no errors are thrown and the application works without any problems. But I'd love to have the Angular Language Service features available even when developing the library itself.
Any clue/help? I've googled around and I found that building two things concurrently from the same workspace is not supported yet? (sounds strange to me...)
Thanks in advance to anyone willing to help