'Unsupported private class xy' while building Angular library

Viewed 2073

I'm developing an npm package with Angular. While building the lib, I get the following error:

Unsupported private class MyLibComponent. This class is visible to consumers via MyLibModule -> MyLibComponent, but is not exported from the top-level library entrypoint.

I found this question. This explains how I fix it, but not why I need to put all components in the barrel file as the Angular documentation for NgModules says:

Exported declarations are the module's public API.

Can someone explain this to me?

0 Answers
Related