ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

SvgIcons definition is overridden in Nx monorepo with several libs #129

Closed BenLune closed 1 year ago

BenLune commented 1 year ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

Hi, First of all, thanks a lot for this lib ! I have a mono repo project with several libs, and I want my icons to be located in the right libs. I was able to use the config-dir option to get several config, but I have a problem with the generated SvgIcons object. It keeps only the last generated icons. So my libs won't compile because definitions are missing. How do you think I can solve that situation?

Expected behavior

Gettings all icons definitions in SvgIcons (types.d.ts)

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: 15.1.5


Browser:
- [ x] Chrome (desktop) version XX
- [ x] Chrome (Android) version XX
- [x ] Chrome (iOS) version XX
- [ x] Firefox version XX
- [ x] Safari (desktop) version XX
- [ x] Safari (iOS) version XX
- [ ] IE version XX
- [ x] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others:

BenLune commented 1 year ago

I tried also multiple with a custom webpack config with 2 SvgGeneratorWebpackPlugin inside, the last one overrides everytime the first one. Maybe I'm missing something or it's definitly not the way to use it

BenLune commented 1 year ago

Finally I created a dedicated icons lib for my app and its libraries. It works very well. I used to work with Angular Material with MatIcon, but when I work on smaller projects which doesn't need Material, it's a pain to use MatIcon alone, due to theming constraints etc. Thanks a lot for that !

NetanelBasal commented 1 year ago

I'm glad to hear that. Thanks.