V
V
Vitalik Cherny2016-06-16 22:16:20
JavaScript
Vitalik Cherny, 2016-06-16 22:16:20

'browser Sync' is not in your gulpfile - what is the problem?

Correct the code please (to comply with js norms - brackets, etc...) thanks

"use strict";

var gulp = require('gulp'),
  sass = require('gulp-sass'),
  watch = require('gulp-watch'),
  browserSync = require('browser-sync');

gulp.task('sass', function(){
  return gulp.src('app/scss/**/*.scss')
  .pipe(sass())
  .pipe(gulp.dest('app/css/'))
  .pipe(browserSync.reload({
    stream: true
  }))
});

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

d3af486e2b324d8c852b4ea85aea233d.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Semenov, 2016-06-17
@Devinora

gulp.task('browser-sync', function() { // Создаем таск browser-sync
    browserSync({ // Выполняем browser Sync
        server: { // Определяем параметры сервера
            baseDir: 'app' // Директория для сервера - app
        },
        notify: false // Отключаем уведомления
    });
});

read here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question