Closed dios-david closed 3 years ago
I may be wrong as I haven't done the initial implementation but https://github.com/cascornelissen/svg-spritemap-webpack-plugin/pull/61, and especially https://github.com/cascornelissen/svg-spritemap-webpack-plugin/pull/61#issuecomment-453736767, seem to have taken this into account.
sprite.idify
is merely there to transform the filename to a valid HTML id. sprite.prefix
can be used to generate a custom prefix for each sprite and that function does get the full path.
Ah thanks, makes sense, I haven't noticed prefix
accepts a function as well.
Hello there! 👋
I recently started to use this great plugin, and I run into an issue: In my project the icons are organised in sub folders (e.g.
actions
,brands
etc), and I would like to include the sub folder name in the generated ID (e.g.{subfolder}-{iconname}
).I noticed there is a way to provide a custom ID generator function in
options.sprite.idify
, but that only receives the file name of the icon as a parameter.So I thought I could add the filepath as the second parameter for
idify
, which would help me to solve my issue without introducing a breaking change.Please let me know if I missed anything!