【问题标题】:Grunt newer:imagemin always runs imagemin:dynamicGrunt newer:imagemin 总是运行 imagemin:dynamic
【发布时间】:2016-07-21 23:41:36
【问题描述】:

我有一个像这样的 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"

有人知道从哪里开始寻找吗?

【问题讨论】:

    标签: javascript node.js gruntjs npm grunt-contrib-imagemin


    【解决方案1】:

    使用 grunt-contrib-imagemin v1.0.1,grunt-newer v0.8.0 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-23
      • 2015-09-25
      相关资源
      最近更新 更多