S
S
Sergey2014-11-06 12:44:49
gulp.js
Sergey, 2014-11-06 12:44:49

Why is gulp-livereload not working correctly?

1. There is a gulp-task like:

gulp.task( 'watch', function() {
    livereload.listen();
    gulp.watch( paths.scss, ['compass']).on( 'change', livereload.changed );
} );

The update is happening, but with the previous version of css, i.e. reload fires first, and then only compass, i.e. the browser shows the past state of the styles, why? How to make reload fire after compiling styles?
2. And the second question is why livereload does not work with specific files:
gulp.task( 'watch', function() {
    livereload.listen();

// работает
    gulp.watch( 'public/**' ).on( 'change', livereload.changed ); 

// не работает
    gulp.watch( 'public/**/*.css' ).on( 'change', livereload.changed ); 
    gulp.watch( 'public/**/*.{png,jpg,css,html}' ).on( 'change', livereload.changed ); 
} );

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question