Open niksajanjic opened 5 years ago
Reasonable request. Though for your particular use case, if you don't include either include
or exclude
then svg-react-loader
will just do all svgs and url-loader
will do all other images. Is that not what you want anyway?
Yeah, sure, that is how it would work. In my case I'm using regex as a solution, just to be sure it will be applied only to images
folder (I'm being extra safe, I have one more folder of images for marketing site).
I just reported this thinking forward. In some specific cases, it could be good to have control over what gets included/excluded for url-loader
too. Even now we could just update webpack config after this plugin runs in our gatsby-node
, it just seems easier to allow it with this lib, that's all.
Agreed, I just wanted to point out that option in the meantime until this gets implemented. I'll try to take a look soon!
I see that whatever gets passed as include or exclude to
svg-react-loader
will be added tourl-loader
too, just other way around, include --> exclude, exclude --> include.That is not correct in all cases. For instance, all my images are held in the same directory. If I put that directory as
include
, it will be excluded forurl-loader
. That can be fixed by passing regex and checking for.svg
extension. But, that is pointless, becausesvg-react-loader
hastest
option for that extension, and passing regex with the same extension would be redundant, but it is important forurl-loader
to work. This gets even worse if I need to excludenode_modules
(for any reason) because they will be included forurl-loader
.I would like to be able to override those options. For instance, I would like to be able to pass
urlLoaderInclude
andurlLoaderExclude
options and override default behavior as it is now.