运行 "htmlmin:dist" (htmlmin) 任务冻结

Running "htmlmin:dist" (htmlmin) task freezes

运行 "htmlmin:dist" (htmlmin) 当我在命令行中 运行 任务冻结时。

我的任务配置如下:

htmlmin: { // Task
  dist: { // Target
    options: { // Target options
      removeComments: true,
      collapseWhitespace: true,
      removeEmptyAttributes: true,
      removeCommentsFromCDATA: true,
      removeRedundantAttributes: true,
      collapseBooleanAttributes: true
    },
    files: [{
      expand: true,
      cwd: '<%= cwdPath %>',
      src: ['**/*.html', '!index-requirejs.html', '!online/**/*.html', '!onlinetradingmanagement/*.html'],
      dest: '<%= destPath %>min/'
    }]
  }
}

文件已根据配置正确缩小和生成,但从命令行执行该任务似乎无法自行完成。

我想将其集成到 Jenkins-CI,因此无法承担冻结任务。

找到了这个问题背后的原因,因为它突然出现在其他人身上。

参考我前几天提出的问题: grunt-contrib-htmlmin

如果 HTML 无效,可能会出现此问题。

尝试运行grunt htmlmin:dist --verbose

检查文件是否存在语法错误,看看是否能解决问题。

这将有助于清除目标目录。 就我而言,grunt 无法覆盖缩小的文件。