gulp-newer icon indicating copy to clipboard operation
gulp-newer copied to clipboard

Newer not detecting changes when multiple files are used

Open hutber opened this issue 10 years ago • 2 comments

I believe there might be something I am missing, but I've gone over it and can't see where it would be going wrong on my side.

    var changed    = require('gulp-changed');
    var newer = require('gulp-newer');
    var SRC = './stylesheets/**/*.scss';
    var DEST = './stylesheets';

    gulp.task('sass', function () {   
        return gulp.src(SRC)
            .pipe(changed(DEST)) //tried newer here as well 
            .pipe(sass())
            .pipe(gulp.dest(DEST))
    });

When changing a scss file it will output there has been a change but not change any scss

    [BS] Watching files...
    [09:26:13] Starting 'sass'...
    [09:26:14] Finished 'sass' after 180 ms

No sass file is output. Is there any way to output the timestamps? Or better still a verbose mode of some kind?

Thanks very much for making this :)

hutber avatar May 28 '15 10:05 hutber

I believe you need to change up your pipe.

gulp.task('sass', function () {   
    return gulp.src(SRC)
        .pipe(newer({
            dest: DEST,
            ext: '.css'
        }))
        .pipe(sass())
        .pipe(gulp.dest(DEST))
});

Sawtaytoes avatar Oct 14 '15 20:10 Sawtaytoes

Thank you, so much!! The same concept can be applied to minified js files (extension .min.js)

tirmey avatar Nov 13 '17 01:11 tirmey