dennispg/gulp-sass-newer

CSS is getting rendered even when no changes are made to the source SASS or its imports

Opened this issue · 0 comments

I tried to solve this by adding this.emit('end') inside the var checkNewer = function.. within the if (!imports || imports.length == 0) condition. Which worked fine when the sass file has at least 1 import but when there are no imports I get TypeError: Cannot read property 'emit' of undefined What should I do here?

I need to make it so that when no changes were made to the source or its imports the rest of the pipe doesn't go through.

My gulp task looks like this (simplified)

gulp.task( 'css', function(){
	gulp.src( ['**/SASS/*.scss'], {base: '.'} )
	.pipe(newer_sass({dest: '.', ext: '.css'}))
	.pipe( sass() )
	.pipe( gulp.dest( '.' ) )
} );