Have the ability to set SVGR built-in configuration
Question
How can I configure the SVGR built-in?
My current loader looks like this:
test: /\.svg$/,
use: {
loader: '@svgr/webpack',
options: {
icon: true,
replaceAttrValues: {
'#1a171b': 'currentColor'
}
}
}
You can use the modifyBundlerConfig
// doczrc.js
export default {
modifyBundlerConfig: (config) => {
/* custom loaders */
config.module.rules.push({
test: /\.svg$/,
use: '@svgr/webpack',
});
return config
}
}
@lasimonne In your example you add the @svgr/webpack loader, but it is already integrated in the new version of docz. Let me know if I misunderstood something.
@danielbayerlein I might have misunderstood you, are you talking about .svgrrc configuration?
@lasimonne Thanks, I did not know the configuration file! But it looks like the configuration file is ignored. 😕
https://github.com/smooth-code/svgr#configurations
Hi @danielbayerlein, that's is something that we need to put on doczrc. I'll do that and put for the last release 🙏
Hi @pedronauck, thank you! You can configure SVGR itself via .svgrrc, svgr.config.js or svgr key in the package.json file.
oh, really? and this work actually with docz too @danielbayerlein ?
@pedronauck Yes, the configuration file .svgrrc works fine.
Cool! So, I'll let just this config instead of put a new property on doczrc, thanks to the tip dude 🙏