gulp-newer
gulp-newer copied to clipboard
Newer not detecting changes when multiple files are used
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 :)
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))
});
Thank you, so much!! The same concept can be applied to minified js files (extension .min.js)