Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Icons are generated successfully in serve mode but not in prod mode #141

Closed
8 tasks
BenLune opened this issue Oct 19, 2023 · 4 comments
Closed
8 tasks

Comments

@BenLune
Copy link

BenLune commented Oct 19, 2023

I'm submitting a...


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

Current behavior

When I serve my app, the icons are generated with no problem. But when I bouild prod, the svg ts files are not generated so my app doesn't compile.

Expected behavior

Svg ts generation files on build prod

Minimal reproduction of the problem with instructions

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

Environment

"nx": "16.10.0",
"@angular/core": "16.2.8",
"@ngneat/svg-icon": "^7.1.0"

Browser:

  • 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

For Tooling issues:

  • Node version: 18
  • Platform: Mac, GitLab CI
@BenLune
Copy link
Author

BenLune commented Oct 19, 2023

My icons are in a lib. Maybe the webpack config is called when building the app. So maybe my lib is built without the svg generator script.

@BenLune
Copy link
Author

BenLune commented Oct 19, 2023

Ok, that's the reason why it didn't work... I spent hours to understand why it didn't work.
Instead of relying on a custom webpack config, I run the svg-generator script before building my lib and my app. I use the "svgGenerator" defined in package.json. It works well, but it would be great to be able to define several svgGenerator objects. In a mono repo we have several apps, which would need different icons sets.
I hope it will help someone.

@BenLune
Copy link
Author

BenLune commented Oct 19, 2023

it runs locally, but it fails on Gitlab CI :
$ svg-generator
/bin/sh: 1: svg-generator: not found

@BenLune
Copy link
Author

BenLune commented Oct 20, 2023

It works now, I don't know exactly why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants