Search code examples
node.jswordpressgitgulp

Launching a Wordpress Project from Github with Gulpfile.js


I have cloned a client's Wordpress repository from Github, however - I am struggling to get it up and running properly.

There is a basic Wordpress setup but the site uses Gulp, by means of a gulpfile.js in the theme directory. This keeps the site minified and builds a 'dist' folder which includes the css and js.

I have all the site files an the theme setup and connected to the database and its all working besides the missing 'dist' folder.

If i dont have node, npm or gulp on my system - do i install them in that order in the theme folder, the root wp folder - or do i not even need to install them? I've tried installing those in the theme folder then running 'gulp' in terminal - but that just tells me i have a bad command.

What do i need to do to execute and run the gulpfile.js is bbasically my question - thank you!


Solution

  • If this does not work you should look into the gulp file (gulpfile.js) the name of the task and run it accordingly, probably will be something like

    gulp build

    eg. for a gulp file with this sass task you will run like so:

    /**
     * Compile Sass.
     */
    gulp.task('sass', function() {
    return gulp.src('./sass/*.scss') // Create a stream in the directory where our Sass files are located.
    .pipe(sass())                    // Compile Sass into style.css.
    .pipe(gulp.dest('./'));          // Write style.css to the project's root directory.
    });
    

    gulp sass

    if none works post the gulp file or more info so we can help you better, good luck.