zont / gulp-usemin

MIT License
338 stars 92 forks source link

Not all html files are processed when using `rev()` #188

Closed JamyGolden closed 7 years ago

JamyGolden commented 7 years ago
const gulp = require("gulp");
const rev = require("gulp-rev");
const usemin = require("gulp-usemin");

gulp.task("prod", () => {
    gulp.src("app/*.html")
        .pipe(usemin({
            css: [ rev() ],
            js: [ rev() ],
        }))
        .pipe(gulp.dest("prod/"));
});

I have multiple html files under app/, which is why I'm using gulp.src("app/*.html"). When using rev() in the css or js array, usemin only processes and copies over the first html file (alphabetically). When removing rev(), they all get processed and copied over.

Any idea what's going on?

zont commented 7 years ago

Look at https://github.com/zont/gulp-usemin#usage:

If you need to call the same pipeline twice, you need to define each task as a function that returns the stream object that should be used.

JamyGolden commented 7 years ago

Thanks!