tasks/index.js
function executeQueuedTasks () {
      // Delay execution to allow for more tasks to queue up
      setTimeout(() => {
        // Check if already executing and if any tasks ready for execution
        if (!executing && (queue.test.length || queue.build.length)) {
          // Flag executing status
          executing = true;
          // Pop a task from the execution queue
          const task = (queue.test.length ? queue.test.splice(0, 1)[0] : queue.build.splice(0, 1)[0]);
          // Execute task
          gulp.series([task])(() => {
            // Flag executing status
            executing = false;
            // Execute next task from the queue
            executeQueuedTasks();
          });
        }
      }, 250);
      // If no tasks queued up, prompt watcher done
      if (!executing && !(queue.test.length || queue.build.length)) {
        console.log();
        console.log(`> WATCHER(S) DONE PROCESSING - WAITING FOR CHANGES ...`.green);
        console.log();
      }
    }
function executeQueuedTasks () {
      // Delay execution to allow for more tasks to queue up
      setTimeout(() => {
        // Check if already executing and if any tasks ready for execution
        if (!executing && (queue.test.length || queue.build.length)) {
          // Flag executing status
          executing = true;
          // Pop a task from the execution queue
          const task = (queue.test.length ? queue.test.splice(0, 1)[0] : queue.build.splice(0, 1)[0]);
          // Execute task
          gulp.series([task])(() => {
            // Flag executing status
            executing = false;
            // Execute next task from the queue
            executeQueuedTasks();
          });
        }
      }, 250);
      // If no tasks queued up, prompt watcher done
      if (!executing && !(queue.test.length || queue.build.length)) {
        console.log();
        console.log(`> WATCHER(S) DONE PROCESSING - WAITING FOR CHANGES ...`.green);
        console.log();
      }
    }
function executeQueuedTasks ( ) { // Delay execution to allow for more tasks to queue up setTimeout ( ( ) => { // Check if already executing and if any tasks ready for execution if ( ! executing && ( queue . test . length || queue . build . length ) ) { // Flag executing status executing = true ; // Pop a task from the execution queue const task = ( queue . test . length ? queue . test . splice ( 0 , 1 ) [ 0 ] : queue . build . splice ( 0 , 1 ) [ 0 ] ) ; // Execute task gulp . series ( [ task ] ) ( ( ) => { // Flag executing status executing = false ; // Execute next task from the queue executeQueuedTasks ( ) ; } ) ; } } , 250 ) ; // If no tasks queued up, prompt watcher done if ( ! executing && ! ( queue . test . length || queue . build . length ) ) { console . log ( ) ; console . log ( ` ` . green ) ; console . log ( ) ; } }
Executes previously queued up tasks, one-by-one
Executes previously queued up tasks one - by - one