I am using gulp -ruby-sass to compile js and sass.
I ran into this error first TypeError: Arguments to path.join must be strings
Found this answer , and that was because I used the source code with gulp -sass , and the answer was recommended using gulp -ruby-sass .
Next, I tried to compile all my SASS files using this syntax:
gulp.task('sass', function () { return sass('public/_sources/sass/**/*.scss', { style: 'compressed' }) .pipe(sourcemaps.init()) .pipe(concat('bitage_public.css')) .pipe(sourcemaps.write('./maps')) .pipe(gulp.dest('public/_assets/css')) .pipe(livereload()); });
What caused this error: gulp-ruby-sass stderr: Errno::ENOENT: No such file or directory - public/_sources/sass/**/*.scss
Then I noticed in the answer that the author found that globes ** are not yet supported:
Also keep in mind that with this entry when using gulp -ruby-sass 1.0.0-alpha globs are not yet supported.
I did more digging and found a way to use Array to specify the paths to my SASS files, so I tried the following:
gulp.task('sass', function () { return sass(['public/_sources/sass/*.scss', 'public/_sources/sass/layouts/*.scss', 'public/_sources/sass/modules/*.scss', 'public/_sources/sass/vendors/*.scss'], { style: 'compressed' }) // return sass('public/_sources/sass/**/*.scss', { style: 'compressed' }) .pipe(sourcemaps.init()) .pipe(concat('bitage_public.css')) .pipe(sourcemaps.write('./maps')) .pipe(gulp.dest('public/_assets/css')) .pipe(livereload()); });
But still I get Errno::ENOENT: No such file or directory and lists all the directories placed in this array.
How to compile SASS in multiple directories using gulp?
Structure of the original SASS folder:
_sources layouts ...scss modules ...scss vendors ...scss main.scss
css sass gulp gulp-ruby-sass
Leon Gaban
source share