Gulp-rev-collector in gulp does not work

  node.js, question

Gulp uses gulp-rev to time stamp the file, but fails to replace it with gulp-rev-collector. is there a configuration error in gulpfile?
The code is as follows:

var gulp  = require('gulp');
 
 var sass = require('gulp-sass');  //compile sass
 var cssMin = require('gulp-minify-css');  //compress css
 var imageMin = require('gulp-imagemin');  //compress pictures
 var rev = require('gulp-rev');  //MD5
 var htmlmin = require('gulp-htmlmin');  //compress html
 var revCollector = require('gulp-rev-collector');  //Replace timestamp
 
 
 gulp.task('sass',function(){
 gulp.src('./SASS/*.scss')
 .pipe(sass())
 .pipe(cssMin())
 .pipe(rev())
 .pipe(gulp.dest('dist/stylesheet'))
 .pipe( rev.manifest() )
 .pipe( gulp.dest( 'rev/stylesheet' ) );
 });
 
 gulp.task('imagemin', function () {
 gulp.src('./images/*.{png,jpg,gif,ico}')
 .pipe(imageMin({
 optimizationLevel: 5,
 progressive: true,
 interlaced: true,
 multipass: true
 }))
 .pipe(rev())
 .pipe(gulp.dest('dist/images'))
 .pipe(rev.manifest())
 .pipe(gulp.dest('./rev/images'));
 });
 
 gulp.task('revCollector', function () {
 
 gulp.src(['rev/**/*.json', './*.html'])
 .pipe( revCollector())
 .pipe(htmlmin())
 .pipe( gulp.dest('dist/'));
 });
 gulp.task('revCollectorCss', function () {
 gulp.src(['rev/**/*.json', './dist/stylesheet/*.css'])
 .pipe(revCollector())
 .pipe(gulp.dest('./dist/stylesheet'));
 });
 
 
 gulp.task('auto', function () {
 gulp.watch('./SASS/*.scss', ['sass'])
 });
 
 
 
 
 gulp.task('default', ['sass', 'auto','imagemin','revCollectorCss','revCollector']);

The directory structure is as follows:

clipboard.png

It is hoped that the images and stylesheet folders and the compressed index.html will be included in the dist:dist generated in the current directory.
After running gulp, MD5 addition has no problem, can generate json under rev, compression has no problem, but no replacement

Please help me see what gulp wrote wrong

When I looked at the document carefully, I found that my code was defective and has been solved now. Mainly refer to herehttp://www.ydcss.com/archives …
The main problem lies in the dependency of each task. It is very likely that the json file of manifest cannot be found when the task is executed. After adding the dependency, replace ok. It is necessary to prompt. Because the dependency is called, it is better to take the return value of Return, which is easier to write.

var gulp  = require('gulp');
 
 var sass = require('gulp-sass');  //compile sass
 var cssMin = require('gulp-minify-css');  //compress css
 var imageMin = require('gulp-imagemin');  //compress pictures
 var rev = require('gulp-rev');  //MD5
 var htmlmin = require('gulp-htmlmin');  //compress html
 var revCollector = require('gulp-rev-collector');  //Replace timestamp
 
 
 gulp.task('sass',function(){
 return gulp.src('./SASS/*.scss')
 .pipe(sass())
 .pipe(cssMin())
 .pipe(rev())
 .pipe(gulp.dest('dist/stylesheet'))
 .pipe( rev.manifest() )
 .pipe( gulp.dest( 'rev/stylesheet' ) );
 });
 
 gulp.task('imagemin', function () {
 return gulp.src('./images/*.{png,jpg,gif,ico}')
 .pipe(imageMin({
 OptimizationLevel: 5, // Type: Number Default: 3 Value Range: 0-7 (Optimization Level)
 Progressive: true, // Type: Boolean Default: false Lossless Compression jpeg format
 Interlaced: true, // type: Boolean default: false interlaced gif rendering
 Multipass: true // type: Boolean default: false optimizes svg multiple times until it is fully optimized
 }))
 .pipe(rev())
 .pipe(gulp.dest('dist/images'))
 . pipe(rev.manifest()) //- generates a rev-manifest.json
 .pipe(gulp.dest('./rev/images'));
 });
 
 gulp.task('revCollector',['revCollectorCss'], function () {
 var options = {
 Remove comments: true//clear HTML comments
 Collapse whitespace: true//compress HTML
 Collapsebouoleanatattributes: true,//omit boolean attribute value < inputchecked = "true"/> = = > < inputchecked/>
 Removemptyattributes: true,//remove all spaces as attribute values < inputid = "/> = = > < input/>
 Removescript TypeAttributes: True//Remove type="text/javascript "for < Script >
 Removestylinktypeattributes: true//remove type="text/css "for < style > and < link >
 MinifyJS: true, // compact page JS
 MinifyCSS: true // compress page CSS
 };
 return gulp.src(['rev/**/*.json', './*.html'])
 .pipe( revCollector())
 .pipe(htmlmin(options))
 .pipe( gulp.dest('dist/'));
 });
 gulp.task('revCollectorCss',['sass','imagemin'], function () {
 return gulp.src(['rev/**/*.json', './dist/stylesheet/*.css'])
 .pipe(revCollector())
 .pipe(gulp.dest('dist/stylesheet'));
 });
 
 gulp.task('auto', function () {
 gulp.watch('./SASS/*.scss', ['sass']);
 });
 
 gulp.task('default', [ 'auto','revCollector']);