Outputting Gulp to multiple files

We have a variable .js file which looks something like this (reduced version)

module.exports = {
  theme_name : "reese/gulpdistrict/theme1", //replace with name of theme folder
};

We then, in our gulpfile.js, include this file in our config variable

var config = require('variable file here');

After connecting to our server in gulp, we then run a bunch of gulp tasks. E.g. our Sass files ultimately get combined into a main.js, our Javascript ultimately gets reduced down to a main.js file.

I believe this is an instance of it “writing” out the CSS file

return gulp.src('src/sass/*.css')
    .pipe(gulp.dest(themepath + 'css'));

Now my question is, given our config setup, we are trying to figure out a way to allow multiple “theme_name”'s to exist (in an array) and I guess loop over each and write the same files, just to different folders in the server. What sort of logic should I try to go for here? Do I need any different gulp plugins? Just looking for a finger in the right direction. I’m imagining I’ll need to do that “return” statement, but within some sort of loop or something like that.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.