grunt-newer icon indicating copy to clipboard operation
grunt-newer copied to clipboard

newer:imagemin:dynamic and newer:imagemin when only one in task

Open dheian opened this issue 11 years ago • 4 comments

Installed newer today and started using it with imagemin. Though the only task specified is newer:imagemin:dynamic, I found that it ran followed by imagemin dynamic:

Running "newer:imagemin:dynamic" (newer) task
Running "imagemin:dynamic" (imagemin) task

Here's the config:

module.exports = function(grunt) {
var mozjpeg = require('imagemin-mozjpeg');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {                          // Task
dynamic: {
 files: [{
    expand: true,                  // Enable dynamic expansion
    cwd: '.',                   // Src matches are relative to this path
    src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
    dest: '.'                  // Destination path prefix
  }]
    }
}
  });
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-newer');
grunt.registerTask('default', ['newer:imagemin:dynamic']);
};

Thanks for any advice.

dheian avatar May 20 '14 00:05 dheian

Here with the same issue, anyone with a solution?

elliot619 avatar Oct 27 '15 00:10 elliot619

+1

codephobia avatar Dec 29 '15 17:12 codephobia

Please make grunt-newer work again with grunt-contrib-imagemin. It doesn't no matter how you configure it.

dimitarkolev avatar Jan 14 '16 16:01 dimitarkolev

Hi i find solution to this issue. In my example imagemin changes modification date of image by cleaning milliseconds from original file. Original file: 2016-04-15 12:16:14.877814125 +0200 Complied file: 2016-04-15 12:16:14.000000000 +0200 my solution to this is set option in newer task tolerance: 1000 or more.

options: {
  tolerance: 1000
}

kfiku avatar Apr 15 '16 13:04 kfiku