Build plugins resolver issue with extensions #2024
Unanswered
mhsattarian
asked this question in
Troubleshooting
Replies: 1 comment 4 replies
-
I might not be following, if you change ".svgr" to ".svg" in |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been trying to access SVG files as elements, but I didn't want to change my imports everywhere.
so I thought to define a virtual extension as
svgr
to load the SVG files I needed as an actual element with a build plugin.here is what I did, I created a plugin to handle only files with
.svgr
extension, and pass them to SVGR plugin to create a React component from it:the problem is this plugin wouldn't affect anything. for example the
console.log
visible here won't be called.Because this same code would work if I change
.svgr
to.svg
inresolve.input
, I guess file extensions supported to resolve for build plugins are pre-defined. If this is true I think it's worth noting in the Plugins Guide.and if this is not the case, can you help me find what's wrong here?
Beta Was this translation helpful? Give feedback.
All reactions