I use Gulp to compile my sass. Since I added Compass to my build every time I make changes, the sass task takes up to 5 seconds.
I read about various cache plugins like gulp-cached , but I can't get it to work. When I add gulp -cached, the runtime is reduced to about 20 ms and only processes the modified sass partial, but the rest of the sass task fails.
Here is my SASS task
gulp.task('styles', function () {
return gulp.src( paths.scss )
.pipe( cache( 'sass' ) )
.pipe( scss( options.scss ).on( 'error', gutil.log ) )
.pipe( autoprefix( options.autoprefix ) )
.pipe( gulp.dest( dests.css ) )
.pipe( livereload() )
.pipe( notify( { message: 'CSS task complete.' } ) );
});
And my full gulp file can be found here: http://hastebin.com/oxuxegayoj.coffee
Should cache plugins work with sass compilation or is this how it should work?
source
share