I'm trying to integrate gulp-rev
with browserify
. I can't seem to get gulp-useref
and gulp-rev-replace
to replace the browserified file with the revved file.
So far I just have these tasks for useref and browserify:
gulp.task('html', function() {
var assets = useref.assets();
return gulp.src('app/*.html')
.pipe(assets)
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', minifyCSS()))
.pipe(buffer())
.pipe(rev())
.pipe(assets.restore())
.pipe(useref())
.pipe(revReplace())
.pipe(gulp.dest('dist'));
});
gulp.task('browserify', ['lint'], function() {
var bundleStream = browserify('./app/scripts/app.js').bundle();
return bundleStream
.pipe(source('bundle.js'))
.pipe(gulp.dest('dist/static/js'));
});
I simply copied what was in the docs from the packages.
Thanks!