sindresorhus / gulp-rev

Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why the source has changed, but the hash no change?

nieyt opened this issue · comments

commented

I have changed the source css code, and rebuild the task, but the hashed css name is the same as before.here is the code.

gulp.task('style', () => {
  var processors = [
    pxtoviewport({
        viewportWidth: 750,
        viewportUnit: 'vmin'
    })
  ];
  return gulp.src(['./h5-cover/style/**/*.css', './h5-cover/style/*.less'])
      .pipe(less())
      .pipe(postcss(processors))
      .pipe(concat({path: 'index.min.css', cwd: ''}))
      .pipe(minifyCss())
      .pipe(rev())
      .pipe(gulp.dest('./resource/css/'))
      .pipe(rev.manifest())        
      .pipe(gulp.dest('./resource/rev/'));
});

Both are the same name :
image

same problem, rev-manifest not changed unless rerun npx gulp

Same here, I have to run it twice

Actually, it doesn't seem to be an issue with gulp-rev. Found out my postcss task wasn't finished by the time it reached rev(), so the first time no changes were detected. Fixed that and it all works.

I also ran into this problem and never found a gulp-rev based solution. I ended up using gulp-hash instead.