1

So I use gulp quite often, mostly for scss/js compilation and minification.

I always use one entry scss file, with multiple imports, but when I add files to the entry file I need to rerun gulp (watch) to include those newly created files..

There must be a way to automatically include the new files?

Minified version of my gulpfile:

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

gulp.task('sass', function () {
    gulp.src('assets/sass/main.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest('assets/css'));
});

gulp.task('sass:watch', function () {
    gulp.watch('assets/sass/**/*.scss', ['sass']);
});
frederikvdbe
  • 385
  • 1
  • 4
  • 10
  • https://stackoverflow.com/a/22391756/197472 – Duderino9000 Sep 06 '17 at 17:44
  • Although some straight advice would've been nice, the link you shared resolved my issue. I included gulp-watch separately and instead of gulp.watch() I used watch() and everything is working now... Thanks @Barryman9000 – frederikvdbe Sep 06 '17 at 18:10

0 Answers0