The gulp build number fails in html

the current problem is that the html file does not have a version number, and you can see

in rev json .

rev-manifest.json

{
  "cas.css": "cas.css?v=2ddef3cfbd"
}

rev-manifest.json

{
  "cas.js": "cas.js?v=a5a6013133"
}
"use strict";

var gulp = require("gulp");
var imagemin = require("gulp-imagemin");           // 
var uglify = require("gulp-uglify");               // js
var babel = require("gulp-babel");                 // babel
var minifyCss = require("gulp-minify-css");        // css
var minifyHtml = require("gulp-minify-html");      // html
var htmlreplace = require("gulp-html-replace");    // html
var rev = require("gulp-rev");                     // gulp
var revCollector = require("gulp-rev-collector");  // gulp

var clean = require("gulp-clean");


// cas-login js
gulp.task("loginJsMin", async function () {
    await gulp.src("src/cas-login/cas.js")
        .pipe(babel())
        .pipe(uglify())
        .pipe(gulp.dest("dist/cas-login"))
});

// cas-login js
gulp.task("loginJsCopy", async function () {
    await gulp.src("src/cas-login/*.min.js")
        .pipe(gulp.dest("dist/cas-login"));
});

// cas-login css
gulp.task("loginCssMin", async function () {
    await gulp.src("src/cas-login/*.css") // css
        .pipe(minifyCss()) //css
        .pipe(gulp.dest("dist/cas-login"))
});

// cas-login html
gulp.task("loginHtmlMin", async function () {
    await gulp.src("src/cas-login/*.html") // html
        .pipe(minifyHtml()) //
        .pipe(gulp.dest("dist/cas-login"));
});


// cas-login 
gulp.task("loginImagesMin", async function () {
    await gulp.src("src/cas-login/images/*")
        .pipe(imagemin())
        .pipe(gulp.dest("dist/cas-login/images"));
});

// cas-login js hash
gulp.task("loginJsHash", async function () {
    await gulp.src("dist/cas-login/cas.js")
        .pipe(rev())
        .pipe(rev.manifest())
        .pipe(gulp.dest("rev/cas-login/js"));
});

// cas-login css hash
gulp.task("loginCssHash", async function () {
    await gulp.src("dist/cas-login/*.css") // css
        .pipe(rev())
        .pipe(rev.manifest())
        .pipe(gulp.dest("rev/cas-login/css"));
});

gulp.task("loginRev", function() {
    return gulp.src(["rev/cas-login/**/*.json", "dist/cas-login/*.html"])
        .pipe(revCollector({
            replaceReved: true    //, 
        }))
        .pipe(gulp.dest("dist/cas-login"));
});

// Build cas-login
gulp.task("login-build",
    gulp.series("loginJsMin", "loginJsCopy", "loginCssMin", "loginImagesMin","loginHtmlMin", "loginJsHash", "loginCssHash", "loginRev", done => {
    done();
}));

what I want to solve is that after every gulp after the css,js change, the most recent version number of the html generation can be marked with

.
May.22,2022

install a plug-in and dynamically replace the version number when gulp build .

var strReplace = require('gulp-string-replace');

gulp.task('replaceVersion', function () {
    var version = new Date().getTime();
    
    gulp.src(['./*.js']).pipe(strReplace(/\d{13}/g, version)).pipe(gulp.dest('./js/'));
    gulp.src(['./*.html']).pipe(strReplace(/\d{13}/g, version)).pipe(gulp.dest('../'));
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b6f6-2c288.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b6f6-2c288.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?