I'm trying to create svg-sprite using npm package svg-sprite. Eventually I get sprite, that looks like this:
// icons-test.svg
...
<svg viewBox="0 0 108 54" ...>
<svg height="54" width="54" viewBox="-2 -2 54 54" ...>
<path d="...”>
</svg>
<svg height="54" width="54" viewBox="-2 -2 54 54" ...>
<path d="...”>
</svg>
</svg>
To define size (for example width) of this svg-sprite I use command identify from util ImageMagick.
identify -format '%w' icons-test.svg
or write it to the file
echo "\$spriteWidth = $(identify -format ‘%w’ icons-test.svg)px" >> styles.styl
The problem is that in file I don't get width of full svg-sprite (108), but only width of last sub-svg image(54), that is included in common svg-sprite.
Please, tell me where is my mistake? How to make identify return correct width. Or advice me another variants to solve the problem.