I found recently that sprites that have the same name as other sprites are included in the generated spritesheet. And yet, unless you customize your particular spritesheet template use sprites based on their source_files rather than your configured naming scheme (which is by default the extension-less name of the sprite's image), they'll be in the generated spritesheet image, but never really accessible.
While there is certainly the possibility of developers out there who are savvier than me and have accounted for this by making modifications to their spritesmith template of choice, I'd be shocked if even the fact of this behavior were even common knowledge for most developers. ('Cause quite frankly, very few developers probably have a legitimate use case for spritesheets that intentionally target sprites of the same name, actually desiring the effect of overriding other sprites, making them inaccessible.)
In sum, I think actually excluding these inaccessible sprites would simply result in a filesize savings for developers who are both (1) in the unfortunate position of having sprites that are overriding other sprites, certainly if (2) they're unaware that that's the case. So I've made a fork of the plugin implementing this how I would do it (and using it in my project), and I'd love to know if there's anything you'd like me to do to it to make it mergeable.
I found recently that sprites that have the same name as other sprites are included in the generated spritesheet. And yet, unless you customize your particular spritesheet template use sprites based on their
source_file
s rather than your configured naming scheme (which is by default the extension-less name of the sprite's image), they'll be in the generated spritesheet image, but never really accessible.While there is certainly the possibility of developers out there who are savvier than me and have accounted for this by making modifications to their spritesmith template of choice, I'd be shocked if even the fact of this behavior were even common knowledge for most developers. ('Cause quite frankly, very few developers probably have a legitimate use case for spritesheets that intentionally target sprites of the same name, actually desiring the effect of overriding other sprites, making them inaccessible.)
In sum, I think actually excluding these inaccessible sprites would simply result in a filesize savings for developers who are both (1) in the unfortunate position of having sprites that are overriding other sprites, certainly if (2) they're unaware that that's the case. So I've made a fork of the plugin implementing this how I would do it (and using it in my project), and I'd love to know if there's anything you'd like me to do to it to make it mergeable.
https://github.com/mixtur/webpack-spritesmith/pull/79