title: How to debug app startup with Gulp
body: <p>I have run into a road block with a new team I am working with that supports a node app.  The app is launched via Gulp, and the setup is such that there is a "core" NPM module that defines a bunch of gulp tasks and a "server", and our app simply installs this package and our code is copied in as a "plugin" to the server.</p>
  
  <p>In our gulpfile.js, we have something like:</p>
  
  <pre><code>var gulp = require('gulp');
  var workflow = require('base-workflow');
  
  workflow.use({ gulp: gulp });
  gulp.task('default'), ['base:default']);
  ...more stuff
  </code></pre>
  
  <p>Where <code>base:default</code> is pulled in and a couple of Hapi servers are ultimately started (one as a "web" app, one as the "rest" proxy app to a real Java-based REST services).  What I would like to do is setup node-inpector so that I can troubleshoot the startup of the app because I have found that the latest versions of their base packages are not Mac-compatible.</p>
  
  <p>What I have tried is to install <a href="https://www.npmjs.com/package/gulp-node-inspector" rel="nofollow">gulp-node-inspector</a> with the following changes:</p>
  
  <pre><code>var gulp = require('gulp');
  var nodeInspector = require('gulp-node-inspector');
  var workflow = require('base-workflow');
  
  workflow.use({ gulp: gulp });
  gulp.task('default'), ['base:default']);
  gulp.task('debug', ['default'], function() { gulp.src([]).pipe(nodeInspector({debugBrk: true})); });
  ...more stuff
  </code></pre>
  
  <p>and also:</p>
  
  <pre><code>var gulp = require('gulp');
  var nodeInspector = require('gulp-node-inspector');
  var workflow = require('base-workflow');
  
  workflow.use({ gulp: gulp });
  gulp.task('default'), ['base:default']);
  gulp.task('debug', function() { gulp.src(['default']).pipe(nodeInspector({debugBrk: true})); });
  ...more stuff
  </code></pre>
  
  <p>but neither of those works.  Part of this is most likely my lack of understanding of Gulp.  Does anyone know how I can debug this app?</p>