grunt-newer
grunt-newer copied to clipboard
newer:imagemin:dynamic and newer:imagemin when only one in task
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.
Here with the same issue, anyone with a solution?
+1
Please make grunt-newer work again with grunt-contrib-imagemin. It doesn't no matter how you configure it.
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
}