Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

eslam said
PLUS
eslam said
Courses Plus Student 6,734 Points

Gulp watch for sass

Gulp is only watching my main scss file and not the sub folders how to make gulp look for all of my scss files ? gulp

const gulp  = require('gulp');
const watch = require('gulp-watch');
const sass  = require('gulp-sass');
gulp.task('sass', function() {
    gulp.src('assets/sass/style.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest('assets/css/'));
});
gulp.task('watch', function(){
    gulp.watch('assets/sass/*.scss', ['sass']);
})

my project folder structure

assets
  sass
     1-basics
     2-layout
     3-helpers
style.scsss

so gulp is only detecting the style.scss and ignoring the other folders, despite that the files inside the folders i imported it on my style.scss

1 Answer

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,684 Points

Your glob pattern isn't correct. Take a look at this CSS-Tricks article on Gulp, specifically pattern number two.

Hope this helps!