Closed SaniHaque closed 5 years ago
generateSpriteName: function (imageLoc) {
let image = imageLoc.split("\\");
let name = image[image.length - 1].replace(".png", "");
return name;
},
dosn;t work. is it because of format: 'json_texture'
, if it is how to solve this.
So there is "png" in sprite names? Like $some-icon-png
?
what is your target.css?
my target is not css, it's json. and i'm using format: 'json_texture' option.
Your problem is here https://github.com/twolfson/spritesheet-templates/blob/master/lib/templates/json_texture.template.js#L21-L27
I am trying to match gulp.spritesmith behaviour.
gulp.spritesmith does not defines sprite.frame_name
, and it puts original file name in sprite.source_image
. So am I.
generateSpriteName
doesn't work here because it only changes sprite.name
. And related code is never reached in this template (at least with versions of webpack-spritesmith >=0.5.0).
So you can do one of two things:
a) write custom template that names sprites in some other way.
b) rollback to 0.4.1, It does not defines sprite.source_image
, so generateSpriteName
would work as you expect (though it may not be needed).
too bad then.☹ thanks anyway.👍
is there a way to remove that extension name on every image name. it's really annoying. Otherwise great job. Thank you.