Hi,
First of all, thank you for this amazing library, it is great!
With version 1.0.0, viewBox is dropped. In my case I have some illustrations that I inline, they are not icons but I still need viewBox to scale them.
I would be happy to contribute and help, but in order to understand where you come from: what is the rationale behind removing viewBox for "non-icons"?
Hi, after #17 I think adding an option 芦聽viewBox聽禄 and defaulting it to true is the best thing. I think viewBox doesn鈥檛 add a lot of data and give ability to resize, it is pretty common with SVG. @troch feel free to make a PR, else I will do it as soon as I have a moment.
For future googlers (like me). It seems the information in this issue is outdated, viewbox settings are now delegated to the svgoConfig. See https://github.com/smooth-code/svgr/issues/142
Webpack snippet:
{
test: /(icons|images)\/.*?.svg$/,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: {
removeViewBox: false
}
}
}
}, 'file-loader']
}
@edorivai yes you are right, viewBox is svgo job!
Note, that in order to work now { removeViewBox: false } should be passed at array:
{
test: /(icons|images)\/.*?.svg$/,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [{removeViewBox: false}]
}
}
}, 'file-loader']
}
Hi,
How to handle this in @svgr/rollup, I mean how to write this config in rollup
Most helpful comment
For future googlers (like me). It seems the information in this issue is outdated, viewbox settings are now delegated to the
svgoConfig. See https://github.com/smooth-code/svgr/issues/142Webpack snippet: