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

[Nx Lib] How to generate icons from svgGenerator ? #54

Closed BenLune closed 2 years ago

BenLune commented 2 years 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, Thanks a lot for this great lib ! I would like to use it in a Nx Lib, but I can't figure how to trigger the svgGenerator script in my lib project.json file. I tried to use the @nrwl/workspace:run-commands command but it doesn't work :

"build-icons": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "svgGenerator": {
          "outputPath": "./src/app/svg",
          "prefix": "lib",
          "srcPath": "./src/assets/svg",
          "svgoConfig": {
            "plugins": [
              {
                "removeDimensions": true,
                "cleanupAttrs": true
              }
            ]
          }
        }
      }
    }

running this command : nx run my-nx-lib:build-icons

Have a nice day ! Benoît

Environment


Angular version: X.Y.Z


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX            
NetanelBasal commented 2 years ago

The config should be in a package.json file.

BenLune commented 2 years ago

ok, thanks a lot @NetanelBasal