I'm trying to combine multiple scss files into one, similar to Gulp: How to create a task that compiles multiple SASS files?; however one of my files is above my gulpfile:
/project_root/
fe/
common/
app/src/main/styles/main.scss
gulpfile.js
module/src/foo/styles/main.scss
My gulpfile looks like this:
gulp.task('styles', function() {
return gulp
.src(
[
'./app/src/**/main.scss', // included
'../module/src/**/main.scss' // NOT included
],
{ base: '.'} // this doesn't seem to matter
)
.pipe( plumber() )
.pipe(
sass({
errLogToConsole: true,
sourceComments : 'normal'
})
)
// …
.pipe(rename('app.css'))
.pipe(gulp.dest('../build/'));
});
I do basically the same thing with my js (*.js
instead of main.scss
), and it works just fine :/
Update: I just noticed that, when I remove the rename from above, the second main.scss does get processed and a main.css is created in the same directory instead of the dest directory.
Update: I tried making the source path start at their common ancestor '../{common,module}/**/main.scss'
(which significantly impacted performance), and now I get 2 copies of the 2nd source file.