Questions tagged [gulp-rev]

a gulp plugin for static assets revisioning.

gulp-rev is a gulp plugin for static assets revisioning by appending a generated content hash to filenames.

The very basic example of revisioning CSS files:

var gulp = require('gulp');
var rev = require('gulp-rev');

gulp.task('default', function () {
  return gulp.src('src/*.css')
    .pipe(rev())
    .pipe(gulp.dest('dist'));
});

It's important to set files to never expire mode in order to make the plugin work correctly.

51 questions
6
votes
2 answers

How to include revisioned files into .html after using gulp-rev?

So I've created this task in gulp: 'use strict'; var gulp = require('gulp'); var gulpGlobals = require('./_gulp-globals.js'); var rev = require('gulp-rev'); var revReplace = require('gulp-rev-replace'); gulp.task('gulp-rev', function () { var…
Tachi
  • 2,042
  • 3
  • 27
  • 44
5
votes
3 answers

Gulp Rev doesn't include paths in my manifest file

I have Gulp tasks set up to concat, minify and fingerprint assets all at once, writing them directly to my assets folder: (the css part) gulp.task('styles:cssmin', function(){ return gulp.src('src/css/*.css') .pipe(concat('main.css'))…
aviemet
  • 1,463
  • 1
  • 15
  • 19
4
votes
2 answers

How can I adapt my gulp static asset revisioning to work with ServiceWorkers?

Context: I have a production application (here if you want to look) that is currently using static asset revisioning using the gulp-rev-all package which is like gulp-rev except that it also handles dependencies when generating content hashes. It…
MalcolmOcean
  • 2,807
  • 2
  • 29
  • 38
4
votes
2 answers

Gulp handle an array of files with gulp-rev

Context I have a gulpfile.js. It basicaly concats two folders with js files to two files to export to a dist folder. It also adds a cache buster and a uglified version for production. //gulpfile.js const gulp = require('gulp'); const sass =…
Florian
  • 725
  • 6
  • 27
4
votes
3 answers

gulp-rev with useref renaming index.html file as well

I'm new to using gulp and am trying to create a gulpfile for my project. My first task is to combine all my script and link tags present in index.html and replace them with only a single tag. To achieve this purpose, I'm making use of gulp-useref…
Yash Kapila
  • 261
  • 7
  • 17
4
votes
2 answers

How to make gulp-newer work with gulp-rev?

The setup is as simple as this: gulp.task('rev-js', function() { return gulp.src('/js/main.js, {base: '.'}) .pipe(newer('_build')) .pipe(rev()) .pipe(gulp.dest('_build')) .pipe(rev.manifest()) …
Tigran Petrossian
  • 1,158
  • 1
  • 7
  • 16
4
votes
1 answer

Gulp task not waiting the completion of the previous task

I have a gulp task that uses streams to write a revised file (using gulp-rev) and another task that uses the previously written manifest file for replacing a variables in an html file. My first task: gulp.task('scripts', function() { // other…
Ronnie
  • 4,959
  • 10
  • 51
  • 69
3
votes
3 answers

Using gulp tasks with PHP view files

This question is more theoretical then practical. Let's say I have project based on PHP framework Symphony/Zend, I also use gulp for frontend work. I would like to do this project in professional way, so I use gulp plugins like jade, clean, uglify,…
user1409508
  • 623
  • 1
  • 12
  • 38
2
votes
2 answers

Gulp rev-del not removing files

do I understand this wrong or is something not right here? I have this piece of code gulp.task("minifyScripts", function () { return gulp.src("assets/scripts/*.js") .pipe(uglify()) .pipe(rev()) .pipe(gulp.dest('assets/scripts/min')) …
2
votes
1 answer

gulp-rev not working with gulp-watch

Below is my code My main issue I have to watch changes of js and css and also based on that generate min file with proper version also my output directory is same that is also one case. 'use strict'; var gulp = require('gulp'); var rename =…
Nikunj Chotaliya
  • 802
  • 8
  • 19
2
votes
0 answers

gulp - cache busting in angularjs

I have a module named "A" which contains all the required compressed files, now this modules minified files are consumed by other modules. Is there a way i can implement cache-busting here for Module A My Question is: Module B's index.html is…
John
  • 1,191
  • 3
  • 19
  • 29
2
votes
0 answers

gulp-rev-all not replacing paths correctly in html located in subfolder

I'm having issues trying to run gulp-rev-all correctly in html files within subfolders. My current site structure is kind of this: /index.html /gulpfile.js /appsubFolder |-> index.html /Content |-> some.css |-> someOther.css /Scripts …
CesarD
  • 573
  • 14
  • 30
2
votes
1 answer

Gulp revisioning with gulp-rev, gulp-rev-replace, gulp-rev-css-url

I am trying to re-write references to my versioned image files with gulp-rev, gulp-rev-replace and gulp-rev-css-url. I have managed to revision the files and merge the manifests with the following gulp code: gulp.task('revision',…
RyanP13
  • 7,413
  • 27
  • 96
  • 166
2
votes
0 answers

Need help using gulp-rev-replace

I am trying to replace the name of two script filenames and a styles file name in my index.html and and using gulp-rev to change the names of updated files with a hash, and gulp-rev-replace to do the actual replacement. I am running into a wall…
Andy Pohl
  • 243
  • 4
  • 14
1
vote
1 answer

versioning css and js files using gulp

We are adding versions to css and js files to do cache busting. I have used gulp-rev-manifest and gulp-rev-collector to achieve this. But every time we do a build all the updated files with the new version number and have to be pushed to production…
lalitha
  • 11
  • 2
1
2 3 4