Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision in css/js files? #17

Open
highlabs opened this issue Oct 27, 2015 · 0 comments
Open

Revision in css/js files? #17

highlabs opened this issue Oct 27, 2015 · 0 comments

Comments

@highlabs
Copy link

Hi! o/ Any chances to add Revision for css/js files? :)

I added in my project, creating new task in gulp:

'use strict';

var gulp = require('gulp');
var rev = require("gulp-rev");
var revReplace = require("gulp-rev-replace");
var config = require('../config');

gulp.task("rev-js", ['browserify'], function(){
  return gulp.src([config.buildDir +"/js/*.js"])
    .pipe(rev())
    .pipe(gulp.dest(config.scripts.dest))
    .pipe(rev.manifest())
    .pipe(gulp.dest(config.scripts.dest))
})

gulp.task("rev-css", ['sass'], function(){
  return gulp.src([config.buildDir +"/css/*.css"])
    .pipe(rev())
    .pipe(gulp.dest(config.styles.dest))
    .pipe(rev.manifest())
    .pipe(gulp.dest(config.styles.dest))
})

gulp.task("revreplace", ["rev-css", 'rev-js'], function(){
  var manifestjs = gulp.src("./" + config.scripts.dest + "/rev-manifest.json");
  var manifestcss = gulp.src("./" + config.styles.dest + "/rev-manifest.json");

  return gulp.src(config.sourceDir + "/index.html")
    .pipe(revReplace({manifest: manifestjs}))
    .pipe(revReplace({manifest: manifestcss}))
    .pipe(gulp.dest(config.buildDir));
});

But I think this are not a best solution. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant