我有一个像这样的 Gruntfile:
grunt.initConfig({
imagemin: {
dynamic: {
files: [
src: ['lib/public/img/*.{png,jpg,jpeg,gif}'],
dst: 'build/public/img/',
expand: true,
flatten: true
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-newer');
当我这样做时grunt newer:imagemin
,它会记录以下内容:
Running "newer:imagemin" (newer) task
Running "newer:imagemin:dynamic" (newer) task
Running "imagemin:dynamic" (imagemin) task
Minified 192 images (saved 1.3 MB)
Running "newer-postrun:imagemin:dynamic:1:/home/goferito/versus/node_modules/grunt-newer/.cache" (newer-postrun) task
第一次是有道理的,但我第二次运行它,就在之后,它不应该缩小任何新的东西。但它再次缩小了 192 张图像。
我已经检查过了,grunt-newer 将时间戳保存在它的 /node_modules/grunt-newer/.cache/imagemin/dynamic/timestamp
版本:
"grunt-contrib-imagemin": "^1.0.0",
"grunt-newer": "^1.1.1"
有人知道从哪里开始寻找吗?