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

feat(react): Add SvgOptions for NxReactWebpackPlugin and WithNx #23283

Merged
merged 1 commit into from
May 13, 2024

Conversation

ndcunningham
Copy link
Contributor

This PR adds the ability to now override our svg options by providing them either using NxReactWebpackPlugin for react apps or withNx for Next.js apps

new NxReactWebpackPlugin({
  svgr: {
    svgo: true,
    titleProp: true,
    ref: true,
  }
}),

This now gives you control on customizing how the svg is handled. Should you need to enable svgo you can provide the config using svgr.config.js

https://react-svgr.com/docs/options/#svgo

closes: #9487

@ndcunningham ndcunningham self-assigned this May 9, 2024
@ndcunningham ndcunningham requested a review from a team as a code owner May 9, 2024 22:19
@ndcunningham ndcunningham requested a review from xiongemi May 9, 2024 22:19
Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 10, 2024 2:34pm

@ndcunningham ndcunningham merged commit 9cd0b42 into master May 13, 2024
6 checks passed
@ndcunningham ndcunningham deleted the feat/svg-react-next-options branch May 13, 2024 14:15
FrozenPandaz pushed a commit that referenced this pull request May 13, 2024
This PR adds the ability to now override our svg options by providing
them either using `NxReactWebpackPlugin` for react apps or `withNx` for
Next.js apps

```
new NxReactWebpackPlugin({
  svgr: {
    svgo: true,
    titleProp: true,
    ref: true,
  }
}),
  ```

This now gives you control on customizing how the svg is handled. Should you need to enable svgo you can provide the config using `svgr.config.js`

https://react-svgr.com/docs/options/#svgo

closes: #9487
(cherry picked from commit 9cd0b42)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have SVGO features enabled when running SVGR webpack plugin
2 participants