• Как настроить gulp-rev для html?

    @crabicode Автор вопроса
    dev
    Всё заработало, просто пошагово нужно было всё разбить

    gulp.task 'minify-html', ['rev-html', 'assets'], ->
      gulp.src 'dist/**/*.html'
        .pipe minifyHtml
          conditionals: true
          spare: true
          loose: true
          empty: true
        .pipe gulp.dest yeoman.dist
    
    gulp.task 'rev-html', ['assets'], ->
      gulp.src ['.tmp/views/**/*.html']
        .pipe do $.rev
        .pipe gulp.dest 'dist/views'
        .pipe do $.rev.manifest
        .pipe gulp.dest yeoman.dist
    
    gulp.task 'cache-html', ['rev-html'], ->
      gulp.src ['dist/*.html', 'dist/**/*.js', 'dist/**/*.css']
        .pipe $.revReplace manifest: gulp.src('./dist/rev-manifest.json')
        .pipe gulp.dest yeoman.dist
    
    gulp.task 'assets', ['haml', 'coffee', 'bower'], ->
      assets = $.useref.assets(searchPath: [yeoman.tmp])
      global = gulp.src paths.index
        .pipe assets
          .pipe $.if('*.js', do $.ngAnnotate)
          .pipe $.if('*.js', do $.uglify)
          .pipe $.if('*.css', $.minifyCss cache: true)
          .pipe do $.rev
        .pipe do assets.restore
        .pipe do $.useref
        .pipe do $.revReplace
        .pipe gulp.dest yeoman.dist
    Ответ написан
    Комментировать