Is it possible to build an css file in dependency to my Theme folder? The problem is i have several themes in there with the same setup gulp should take Theme.scss and build an css file into Theme, Theme1 and so on.
gulp.task('sass', function () {
return gulp.src('Css/Clients/**/theme.scss') // Gets all files ending with .scss
.pipe(sass({outputStyle: 'compact'}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('watch', ['browserSync', 'sass', 'php'], function () {
gulp.watch('Css/**/*.scss', ['sass']);
})
Edit:
im tryed the solution below the problem i get looks like this :
but i need just the theme.css in theme folder ander theme1.css in theme1 folder and so on! any suggestions ?
gulp.task('sass', function () {
var folders = getFolders(scriptsPath);
var tasks = folders.map(function(folder) {
return gulp.src(path.join(scriptsPath, folder, '/**/*.scss'))
.pipe(sass({outputStyle: 'compact'}))
// concat into foldername.js
.pipe(concat(folder + '.css'))
// write to output
.pipe(gulp.dest(scriptsPath))
// write to output again
.pipe(gulp.dest(scriptsPath));
});
return merge(tasks);
console.log(folders);
});

