Open betsydupuis opened 9 years ago
On running the task multiple times, it'll also add the same icon to the output file each time. Should it clear the output file before adding definitions again?
Maybe output an error?
Another away to deal with it would be for:
files: {
'tmp/default_options.svg': ['test/fixtures/codepen.svg',
'test/fixtures/remote/codepen.svg']
},
To output:
<svg xmlns="http://www.w3.org/2000/svg">
<symbol viewBox="0 0 100 100" id="codepen">
<title>Codepen Icon</title>
<desc>This is the offical Codepen icon</desc>
...
</symbol>
<!------- Add the remote directory as prepended part of the name/id ------->
<symbol viewBox="0 0 100 100" id="remote-codepen">
<title>Remote Codepen Icon</title>
<desc>This is the offical Codepen icon</desc>
...
</symbol>
</svg>
A real world example would be attempting to compile two icon sets into one sprite sheet. Personally, I'm maintaining legacy icons while trying to minify the icon set.
The thing is that although the files may be of the same name, generating the same ID. They could be completely different svgs, which the naming being the only similarity. I am thinking the error message might be the best way to deal with it.
@Samic8 Yes, I think an error output would accommodate most situations.
Just proposed a possible solution, which works for a project of mine with Pull Request #143
It is possible to produce duplicate svgs specifying files with the same name in different directories
gruntfile.js
Result SVG