0

from gulp-rev @ link : https://github.com/sindresorhus/gulp-rev I have wrote a task to simple

gulp.task('build-app', function () {
   return gulp
        .src([gulpConfig.clientApp + '*.js'])
        .pipe($.rev())
// i want to get the updated hash, which I will use to replace the string in some place

}

Any idea how to acheive it ?

Dreamweaver
  • 1,328
  • 11
  • 21

1 Answers1

0

You can use gulp-filenames to store the new/hashed filename. I haven't done this with gulp-rev but I have with gulp-freeze

gulp.task('css', function () {
    return gulp.src('./js/**/*.js')
        .pipe(freeze())
        .pipe(filenames('some-string'))
        .pipe(gulp.dest('./dist'));
});

Then in another task you can get that hashed filename with:

filenames.get('some-string');
Duderino9000
  • 2,535
  • 4
  • 31
  • 37