R
R
Raul Abdullin2017-03-09 21:10:49
gulp.js
Raul Abdullin, 2017-03-09 21:10:49

Did I write everything correctly in gulpfile.js?

Please check the correctness of the code. I'm just getting started with Gulp.

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

gulp.task('sass', function() {
  return gulp.src('app/sass/**/*.sass')
    .pipe(sass())
    .pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
    .pipe(gulp.dest('app/css/'))
    .pipe(browserSync.reload({stream: true}))
});

gulp.task('browser-sync', function() {
  browserSync({
    server: {
      baseDir: 'app'
    },
    notify: false
  })
});

gulp.task('watch', ['browser-sync', 'css-libs', 'scripts'], function () {
  gulp.watch('app/sass/**/*.sass', ['sass']);
  gulp.watch('app/**/*.html', browserSync.reload);
  gulp.watch('app/js/**/*.js', browserSync.reload);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2017-03-09
@raulvodov

Add more at the end
gulp.task('default', ['watch']);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question