title: Gulp 4 - Gulpfile.js set up
body: <p>I'm finding documentation on Gulp 4 extremely hard to find so I thought I might ask here to see if anyone can help. </p>
  
  <p>I'm pretty new to Gulp anyway and have been using Gulp 3 without any problems until I tried running it on a virtual machine we use for development. My gulp file is very straight forward I just use gulp-sass to compile SASS to a css file which was working fine but every time it saves the css file it changes the write permissions on the file and the browser can't read the file! </p>
  
  <p>So I did a bit of research and apparently this is an issue with Gulp 3 which has now been fixed in Gulp 4 - see - <a href="https://github.com/gulpjs/gulp/issues/1012" rel="noreferrer">https://github.com/gulpjs/gulp/issues/1012</a>. So I thought I would try Gulp 4 so I updated as per instructions here - <a href="http://www.ociweb.com/resources/publications/sett/gulp-4/" rel="noreferrer">http://www.ociweb.com/resources/publications/sett/gulp-4/</a> but I'm having real problems setting up the actual gulpfile.js as I can't find any documentation on it. This is what I have pieced together at the moment but no luck... unfortunately my js skills are lacking!!</p>
  
  <p>Example Gulp 4 file here - <a href="https://gist.github.com/demisx/beef93591edc1521330a" rel="noreferrer">https://gist.github.com/demisx/beef93591edc1521330a</a></p>
  
  <p>All I need the gulpfile to do is compile sass using gulp-sass</p>
  
  <pre><code>// include gulp
  var gulp = require('gulp');
  
  // include plugins
  var sass = require('gulp-sass');
  
  
  var paths = {
    dirs: {
      build: './furniture/css'
    },
    sass: './furniture/sass/**/*.scss'
  };
  
  
  // Shared tasks
  gulp.task('glob', function () {
    var pattern = '.build/**/*.css';
  
    gulp.src(pattern, { read:false })
      .pipe(using());
  });
  
  // SASS
  
  gulp.task('sass', function () {
    return gulp.src(paths.sass)
      .pipe(sass())
      .pipe(changed(paths.dirs.build))
      .pipe(gulp.dest(paths.dirs.build))
      .pipe(grep('./furniture/css', { read: false, dot: true }))
  });
  
  gulp.task('watch:styles', function () {
    gulp.watch(paths.sass, 'sass');
  });
  
  // Default task
  gulp.task('default'('build', 'ws', 'watch'));
  </code></pre>