Tuesday, 25 April 2017

grunt image-min generating wrong images

I've been using gruntjs without any problems for a long time, but I got a weird issue with image-min package.

My project works basically this way: I have 2 folders:

  • htdocs
  • htdocs_src

When I run the command grunt deploy, it uses the image-min plugin to copy images from htdocs_src to htdocs folder.

What is happening?

I added 6 different images to the project at the same time and when I run grunt deploy (or even grunt image-min), the 6 images are moved to the htdocs folder, with their respective names, but they're all getting the same image.

To illustrate it better, here are the images inside HTDOCS_SRC folder: http://take.ms/6fR4N

and here are the images inside HTDOCS folder, after running grunt deploy: http://take.ms/hHz73

I've never had this problem adding several images in this project.

Wat have I tried?

  • I asked other team mates to update their code and run 'grunt deploy' in their machines, and for them, all worked well.
  • I ran npm cache clean, hoping that it would be some cache issue, but it didn't work.
  • I also suspected it could be a image-min bug, due to the fact the images have the same prefix (line-) so it could be something.. but, once it worked for my team mates, it can't be this.

The image-min in my package.json file is using version 1.0.1:

"grunt-contrib-imagemin": "^1.0.1",

Any ideas what can be causing this trouble?

I know that probably if I setup the project again, this issue may disappear, but I really would like to understand what's happening.



via Periback

No comments:

Post a Comment