Open maxencelaurent opened 2 years ago
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.
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.
🐛 Bug Report
If a global svgo.config.js is defined (eg. in home directory), svgr may fail to load some SVGs.
To Reproduce
Load SVGs with "@svgr/webpack" loader. Do not define any parameters.
Create a dummy svgo.config.js file in your home: (~/svgo.config.js)
Create an SVG with some namespaces defined:
Import it in your code:
As the global svgo config defines no plugins, the SVG is not sanitized and still contains
xmlns:svg
attribute. Such a svg will be rejected by@babel/plugin-transform-react-jsx
.Expected behavior
SVGR should ignore the global svgo config.
Link to repl or repo
Setup repo
Build without global config is fine:
Create the global config and re-build:
Output:
Run
npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard