It has been weeks now, that I search for a solution.
I created (with ng generate library) a library with the UI in for new webprojects here at work... in fact every component
in that "template library
" has the ViewEncapsulation.None
set... I know it's not the way we should use Angular, but it would allow us to reuse all the hard work that has been done in previous years.
I want to "pack" the stylesheets (.css files)
into the library
in a way that when somebody does an "npm install templatelib
" he/she'll get all the styles and fonts automatically included in their application, no need to manually copy the styles
and fonts
in their src/app
.
I want to give my users an atomic unit in a way somebody just needs to set a template-lib-tag
in their app.component.html
and they're all set... then they would only need to add the content
components
they want to show/use inside the templates design.
I've tried pretty much everything I could find to "pack" the assets, but I either get errors stating that the Data path "" should NOT have additional properties(styles)
. when I try to add assets or styles to the angular.json... or it doesn't do what I want it to do resulting in errors that it can't find the assets during ng serve.
Am I too much demanding of Angular Libraries ? Or is a library filled with components
and their CSS
not an atomic unit that I can plug
into any other Angular app ?
What am I doing wrong/misunderstanding, and how should we "pack" assets into our library so they travel along when installing the package.
Thanks for clarifying in advance.