Gulp watch deleting css on second run

142 Views Asked by At

I'm using CodeAnywhere (cloud IDE) and installing gulp. Running 'gulp sass' works fine every time, but when I 'gulp watch' the 'sass' task runs fine the first time. After that it just creates an empty style.css file. I'm following the 'gulp for beginners' post on css-tricks.

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function() {
  return gulp.src('src/scss/**/*.scss')
    .pipe(sass())
    .pipe(gulp.dest('src/css'))
})

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

My file structure is laid out as follows:
enter image description here

0

There are 0 best solutions below