-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix transformer-svg-react not finding .svgrrc's #7741
Conversation
|
Though actually, wait, it should probably use parcel's own loadConfig stuff for caching and whatnot. One sec. |
fb8d697
to
b8330fa
Compare
Can you add a test case for using a svgr config file? |
Alright, added. I'm realizing though that ideally the |
(And maybe that should be done in a different PR? idk) |
c984edc
to
c972bd7
Compare
Is the failure just a fluke? |
c972bd7
to
f2086a3
Compare
According to the docs, The
Yeah, I think putting that code into some shared package would be the best way. But that's actually a separate problem for another PR. |
'svgo.config.json', | ||
'svgo.config.js', | ||
'svgo.config.cjs', | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the SVG optimizer only supports svgo.config.*
. Maybe we should match that here?
'svgo.config.cjs', | ||
]); | ||
if (svgrResult) { | ||
let isJavascript = path.extname(svgrResult.filePath) === '.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should also handle .cjs
Test appears to be failing... |
Forgot to rename the |
* upstream/v2: Make sure we're compiling on ubuntu-20.04 v2.8.1 Add mjs and cjs to resolver extensions (#8667) Fix transformer-svg-react not finding .svgrrc's (#7741) Fix overriding single export of a `export *` (#8653) chore: spelling fix (#8614) Parse shortcut icons in web app manifests (#8660) Make ts-types transformer work with TS >= 4.8 (#8661) Don't retarget dependencies with `*` (#8645) fix: remove @parcel/utils dep in @parcel/graph (#8630)
↪️ Pull Request
componentName
was being passed asfilePath
instead ofcomponentName
and as a side effect svgr couldn't properly find a.svgrrc
file, if there was one.Closes #8270