I’m setting up gulp to automate our WordPress build process. The current folder structure we use is ClientWebsite/wp(this holds the core files) and then ClientWebsite/wp-content/themes/custom-name/(this holds the custom theme). I would like to keep our gulp in the wp folder as this sits in our git repo and is never changed, but used on every site.

In gulp is there a way to call in the custom-name folder without having to name each client folder in the gulpfile.js file.

For instance:

var sass = require('gulp-sass');
gulp.task('sass', function () {
gulp.src('wp-content/themes/custom-name-for-each-client/library/scss/style.scss')
  .pipe(sass())
  .pipe(gulp.dest('wp-content/themes/custom-name-for-each-client/library/css'));
});

For the custom-name-for-each-client, is there a way to set up a variable to read what that folder is named when we create a theme folder, so that we don’t have to change it for each client?

Thanks.

Read more here: Configure gulp in a separate folder than WordPress theme


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: