question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't turn off removeViewBox

See original GitHub issue

This config still removes the viewBox attribute from SVGs loaded with react-svg-loader. Why is that?

options: {
	svgo: {
		plugins: [
			{
				convertPathData: { noSpaceAfterFlags: false },
				removeViewBox: false,
			},
		],
	},
},

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
oatmeaIcommented, Apr 13, 2020

if anyone else comes across this, it was my fault; the config should have been:

options: {
	svgo: {
		plugins: [
			{ convertPathData: { noSpaceAfterFlags: false } },
			{ removeViewBox: false },
		],
	},
},
2reactions
peterkriegcommented, Apr 3, 2020

Ah I see, thanks - I actually ended up just using svgr/webpack instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable removeViewBox plugin in Next.Js and svgr?
I would like to disable the removeViewBox plugin in Next.js/svgr/svgo. The following next.config.js should work but it does not.
Read more >
react-svg-loader - Bountysource
Can't turn off removeViewBox $ 0. Created 2 years ago in boopathi/react-svg-loader with 4 comments. This config still removes the viewBox attribute from ......
Read more >
https://surgbook.net/node_modules/svgo/CHANGELOG.md
You can turn it off by setting ``utilizeAbsolute`` to ``false``. ... plugins/removeViewBox: doesn't catch floating-point numbers (fix ...
Read more >
Sara Soueidan on Twitter: "The viewBox (& its ...
If you use SVGO to optimize your SVGs, disable the "remove viewBox" option. ... because they cannot deal with the discomfort of negotiation....
Read more >
nuxt-svgo - npm
We disable the SVGO functionality of vue-svg-loader , instead relying on ... or disable plugins removeDoctype: false, removeViewBox: false ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found