tschaub / gulp-newer

Pass through newer source files only
https://npmjs.org/package/gulp-newer
226 stars 24 forks source link

Newer not detecting changes when multiple files are used #18

Open hutber opened 9 years ago

hutber commented 9 years ago

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 :)

Sawtaytoes commented 8 years ago

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))
});
tirmey commented 6 years ago

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