title: gulp-uncss 'TypeError' undefined when used with gulp-if
body: <p>I started loving gulp but I've been having too many cryptic errors that are very hard to find and at the end I'm working for my gulpfile.js instead of doing my job.</p>
  
  <p>Anyway, I tried <code>gulp-uncss</code> before, outside <code>gulp-useref</code> and therefore outside <code>gulp-if</code>, but my <code>gulpfile.js</code> ended up too bulky and unreadable. Now it's readable but it doesn't work. Hurray.</p>
  
  <pre><code>var p = require('gulp-load-plugins')();
  
  gulp.task('html', function () {
      var assets = p.useref.assets();
  
      gulp.src('*.html')
          .pipe(assets)
          .pipe(p.if('*.js', p.uglify()))
          .pipe(p.if('*.css', p.uncss()))
          .pipe(assets.restore())
          .pipe(p.useref())
          .pipe(gulp.dest(build_folder))
          .pipe(p.size());
  });
  </code></pre>
  
  <p>That generates this:</p>
  
  <pre><code>[12:47:53] /long/path/web $ gulp html
  [12:48:06] Using gulpfile /long/path/web/gulpfile.js
  [12:48:06] Starting 'html'...
  [12:48:07] 'html' errored after 507 ms
  [12:48:07] TypeError: Cannot set property 'ignoreSheets' of undefined
      at Object.module.exports (/long/path/web/node_modules/gulp-uncss/index.js:14:26)
      at Gulp.&lt;anonymous&gt; (/long/path/web/gulpfile.js:45:31)
      at module.exports (/long/path/web/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
      at Gulp.Orchestrator._runTask (/long/path/web/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
      at Gulp.Orchestrator._runStep (/long/path/web/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
      at Gulp.Orchestrator.start (/long/path/web/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
      at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
      at process._tickCallback (node.js:355:11)
      at Function.Module.runMain (module.js:503:11)
      at startup (node.js:129:16)
      at node.js:814:3
  [12:48:12] /long/path/web $ 
  </code></pre>
  
  <p>Uncss was crucial to my workflow and I can't crack what's going wrong here. Any clue?</p>
  
  <p>EDIT: This is what's in <code>/long/path/web/node_modules/gulp-uncss/index.js</code> until line 14</p>
  
  <pre><code>'use strict';
  
  var uncss       = require('uncss'),
      gutil       = require('gulp-util'),
      assign      = require('object-assign'),
      transform   = require('stream').Transform,
  
      PLUGIN_NAME = 'gulp-uncss';
  
  module.exports = function(options) {
      var stream = new transform({ objectMode: true });
  
      // Ignore stylesheets in the HTML files; only use those from the stream
      options.ignoreSheets = [/\s*/];
  </code></pre>