0
votes

My tasks are as follows:

gulp.task('sass', function () {
gulp.src(paths.webroot + '/css/**/*.scss')
  .pipe(sass().on('error', sass.logError))
  .pipe(gulp.dest(paths.webroot + '/css'));
});

gulp.task('sass:watch', function () {
gulp.watch(paths.webroot + 'css/**/*.scss', ['sass']);
});

My folder structure:

css
  libs
     _partial1.scss
     _partial2.scss
  main.scss

How can I ignore all files with underscore or go after only top level files in css (ignoring libs)

1

1 Answers

0
votes

To go after only top level files in css/ and ignore css/libs, do:

gulp.src(paths.webroot + '/css/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest(paths.webroot + '/css')); });

I'm guessing you're already importing the partials in your main.scss or some other top level file.