You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are more or less issues/suggestions that I thought may be useful feedback. There may be a config way around these, but I want to share how I solved them.
By default it seems like the plugin configs Webpack to use both url-loader and svgr/webpack. Would be nice to be able to opt into or out of the url-loader.
There is either a bug or "feature" of Webpack currently where the presence of an issuer rule will prevent Webpack from using a loader on files dynamically imported, since we load a folder of filename.svg files through require.context, the default gatsby-plugin-svgr loader config would not work. (Rule with issuer is not applied when importing via require.context webpack/webpack#9309)
In either case, I got around both of these issues by more manually configuring the gatsby-node.js webpack config. However, it seems a bit round about -- I may not even need to use this plugin given the amount of webpack config changes I am making to the default config provided.
The text was updated successfully, but these errors were encountered:
I think we'd be open to a PR that makes presence of the url-loader configurable, provided it remains on by default.
As for the conflict between dynamic imports and issuers, I don't think there's any other way for this plugin to exclude a React-specific loader (svgr) from being used when importing in CSS files, so yes, it seems like in this scenario a custom configuration would likely be better.
These are more or less issues/suggestions that I thought may be useful feedback. There may be a config way around these, but I want to share how I solved them.
By default it seems like the plugin configs Webpack to use both
url-loader
andsvgr/webpack
. Would be nice to be able to opt into or out of the url-loader.There is either a bug or "feature" of Webpack currently where the presence of an issuer rule will prevent Webpack from using a loader on files dynamically imported, since we load a folder of
filename.svg
files throughrequire.context
, the defaultgatsby-plugin-svgr
loader config would not work. (Rule with issuer is not applied when importing via require.context webpack/webpack#9309)In either case, I got around both of these issues by more manually configuring the gatsby-node.js webpack config. However, it seems a bit round about -- I may not even need to use this plugin given the amount of webpack config changes I am making to the default config provided.
The text was updated successfully, but these errors were encountered: