-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Have SVGO features enabled when running SVGR webpack plugin #9487
Comments
The same applies to the Next.js configuration. Is there any reason why |
Any thoughts or work on this? Would also like to configure some SVGO functionality, would seem pretty feasible to allow the configuration of SVGR in |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This is still an issue. |
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
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)
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
When importing SVGs as React components, the SVGR Webpack plugin is working fine and able to be configured through a standalone
svgr.config.js
file (or similar) as supported by the underlying tool. The issue however is that any options related to SVGO functionality do not work. It seems as if the SVGO step in the pipeline has been permanently disabled based on the React webpack config. Would it be possible to re-enable SVGO in the SVGR pipeline so that imported SVG components can be optimized however the end user wishes (either based on the plugin defaults or overridden through a separate config file)? I'm not sure why this would be disabled in the first place.Motivation
Since SVGR is included in the build tooling, it would be most beneficial to be able to utilize all of its functionality as opposed to disabling a significant portion of its feature set.
Suggested Implementation
Remove the
svgo: false
config line in the React webpack config. End users would then be able to configure its operation (or disable it completely) through an external config file.The text was updated successfully, but these errors were encountered: