jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

concats two files into one of the original files, instead of to the dest! #251

Closed Saborknight closed 6 years ago

Saborknight commented 6 years ago

This is doing the above, making a file with content1 suddenly contain content2 from the other file at the top of the first file. Every time the build process is run, content2 is added on above content1, which means I have multiple instances of content2, which keeps on being appended by more content2....

Why?

gulp.task("concat", ['css'], function() {
    return gulp.src(['**/*.html', '**/*.php', '!node_modules/**/*.*'])
        .pipe(useref())
        .pipe(gulp.dest('temp'));
});

gulp.task("css", ['sass'], function() {
    return gulp.src('assets/css/**/*.css')
        .pipe(autoprefixer())
        .pipe(gulp.dest('assets/css/'));
});

gulp.task("sass", function () {
    return gulp.src('assets/scss/**/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('assets/css/'));
});
Saborknight commented 6 years ago

Nevermind, I found the problem.

Note to anyone else confused, double check the actual HTML blocks make sense and aren't overwriting the original file! Silly me didn't double check an age old gulpfile...