Closed gembin closed 8 years ago
Sorry, didn't understand your problem. Check the Usage section, it doesn't need any index.html
to work.
Sorry! Here is an example shows what i did.
gulp.task('build', function () {
//....
return gulp.src(path.join(conf.paths.tmp, '/serve/index.html'))
.pipe($.useref({}, lazypipe().pipe($.sourcemaps.init, { loadMaps: true })))
.pipe($.rev())
// ... minify css
// ... minify js
// .. minify html
.pipe(gulp.dest('build'))
});
And the index.html just get renamed to something like index-d3cdb828b3.html
@gembin you are not using it correctly. I've found a blog post which might help you - http://bendetat.com/cleaning-and-simplifying-the-gulp-pipeline.html
Thanks a lot, I will try it.
@gembin I just updated useref
of our build today and faced the same problem. I solved it with-
.pipe(gulpIf('!*.html', rev()))
I hope it will help.
Awesome, it works !
BTW: is it possible to provide an option to use custom hash function?
e.g. i want app.js
renamed like app-v1.0.0.js
@gembin I don't think so. It doesn't go with the main goal of our plugin.
Thanks @torifat for the tip.
.pipe(gulpIf('!*.html', rev()))
Might be useful for many people to add this tip in the documentation, don't you think?
Before knowing about that, I was using .pipe(rename('index.html'))
at the end but that was not optimal.
How to rev without index.html ? Currently my index.html is renamed