I have many icons exported by "Figma" in a folder structure, I have used grunt-svgstore to generate the sprite sheet but I'm getting duplicated ids in the result.
I have tried with "allowDuplicateItems: false" and "setUniqueIds: true" but it doesn't work.
Folder structure:
-icons
--arrow
---arrow-left
----scale.svg
---arrow-right
----scale.svg
--checkbox
---active.svg
---inactive.svg
--chevron
---left-chevron
----scale.svg
---right-chevron
----scale.svg
--etc.
Grunt file JS:
module.exports = function(grunt) {
grunt.initConfig({
svgstore: {
options: {
formatting : {
indent_size : 2
},
includeTitleElement: false,
preserveDescElement: false,
allowDuplicateItems: false,
setUniqueIds: true
},
default: {
files: {
'includes/defs.svg': ['icons/**/*.svg',]
},
},
}
});
grunt.loadNpmTasks('grunt-svgstore');
};
Expected result based on relative path
<svg>
<symbol viewBox="0 0 32 32" id="arrow-arrow-left-scale">
...
</symbol>
<symbol viewBox="0 0 32 32" id="arrow-arrow-right-scale">
...
</symbol>
</svg>
Actual result:
<svg>
<symbol viewBox="0 0 32 32" id="scale">
...
</symbol>
<symbol viewBox="0 0 32 32" id="scale">
...
</symbol>
</svg>