Magnus von Bromsen
Magnus von Bromsen

Reputation: 336

Grunt and Imagemin does not minify images

I'm using Imagemin with Grunt, and have the following task setup in Gruntfile.js

imagemin: {
      options: {
        optimizationLevel: 5,
        progressive: true,
      },
      dev: {
        files: [{
         expand: true,
        cwd: 'src/img/',
        src: ['**/*.{png,jpg,gif}'],
        dest: 'app/minimg/'
      }]
   }
},

It looks like it is working because if I run "grunt imagemin", the output files is saved in the dest folder - and I get this message:

Running "imagemin:dev" (imagemin) task
Minified 13 images (saved 0 B)

But, why is the images not compressed ("saved 0 B") ? I have tried with a lot of different files both png and jpg. And it is always 0 B.

// Magnus

Upvotes: 1

Views: 858

Answers (1)

Vishnu Aniyan
Vishnu Aniyan

Reputation: 1

Please try the latest version 'grunt-contrib-imagemin' . It Worked for me :)

//uninstalled the package. add -g flag if you've installed it globally.
npm uninstall grunt-contrib-imagemin --save-dev

//install again
npm install grunt-contrib-imagemin --save-dev

Upvotes: 0

Related Questions