mardi 4 octobre 2016

livereload work just once

The problem is that when i'm start

gulp watch

and change sass file, the page is reloading and build the project just once. Then it stop on task sass and if i want change other sass files - nothing happend then(see logs below). How could i solve it?

gulp.task('sass', wrapPipe(function(success, error) {
     return gulp.src('app/css/scss/style.scss')
         .pipe(sass({
             includePaths: [
                 './bower_components/foundation-sites/scss'
             ]
         }).on('error', error))
         .pipe(gulp.dest('app/css'))
         .pipe(browserSync.reload({
             stream: true
         }));

    }));

    gulp.task('livereload', function () {
        browserSync.init({
            server: "./app",
            notify: false
        });
    });

    gulp.task('watch', ['livereload'], function(){
        gulp.watch('app/css/scss/**/*.scss', ['sass']);
    });

This is logs:

[18:52:39] Starting 'livereload'...
[18:52:39] Finished 'livereload' after 20 ms
[18:52:39] Starting 'watch'...
[BS] Reloading Browsers...
[18:52:39] Finished 'watch' after 33 ms
[BS] Access URLs:
 -------------------------------------
       Local: http://localhost:3000
    External: http://ift.tt/2cQvliX
 -------------------------------------
          UI: http://localhost:3001
 UI External: http://ift.tt/2dH9eSm
 -------------------------------------
[BS] Serving files from: ./app
[18:52:50] Starting 'sass'...
[BS] 1 file changed (style.css)




Aucun commentaire:

Enregistrer un commentaire