-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
Support esm config #707
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any chance this will be supported? |
Good workaround is to use for example https://react-svgr.com/docs/configuration-files/#configuration-files |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We are using Another workaround is to use any of the non-js alternatives that will be picked up: svgr/packages/plugin-svgo/src/config.ts Lines 4 to 14 in 82928f0
|
no issue - normally we'd have a `<title>` in SVG icons for easier location during development and strip them out in production builds using SVGO. However, SVGR doesn't support SVGO in module packages yet so we haven't been stripping them resulting in unwanted/unexpected text showing on hover in production - upstream issue gregberge/svgr#707 - stripped all remaining uses of `<title>` in SVGs, we'll add them back at some point in the future once we can use SVGO
🚀 Feature Proposal
Since svgo version 2.7.0 there is support for configs written as es modules: svg/svgo#1583
Please also support this kind of config in svgr.
Motivation
I am trying to convert my library to esm, but this leads to the svgo.config,js within it to also being interpreted as esm.
Then the build fails with the following error:
Example
Simply declare the svgo.config.js as
Additional remarks
It would be also be fine for me if svgr would simply accept/find an svgo.config.cjs in the old format.
But since svgo already supports this I guess it might be easiest to simply support esm?
The text was updated successfully, but these errors were encountered: