title: How to use gulp-load-plugins with Browser-Sync?
body: <p>I'm at a point in my Gulp usage that it's starting to make sense splitting tasks up into separate files. </p>
  
  <p>For this, I was hoping to use <code>gulp-load-plugins</code>, but although my task runs, Browser-Sync doesn't appear to fire / do anything.</p>
  
  <p>Here's my stripped back setup. Not sure where I'm going wrong!</p>
  
  <p><strong>gulpfile.js</strong></p>
  
  <pre><code>var gulp = require('gulp'),
      plugins = require('gulp-load-plugins')();
  
  function getTask(task) {
      return require('./gulp/tasks/' + task)(gulp, plugins);
  }
  
  gulp.task('browser-sync', getTask('browser-sync'));
  gulp.task('bs-reload', getTask('bs-reload'));
  gulp.task('scripts', getTask('scripts'));
  
  gulp.task('default', ['browser-sync'], function(){
      gulp.watch('src/js/**/*.js', ['scripts']);
  });
  </code></pre>
  
  <p><strong>scripts.js (Gulp Task)</strong></p>
  
  <pre><code>var browserSync = require('browser-sync').create();
  
  module.exports = function(gulp, plugins) {
  
      return function() {
  
          return gulp.src([
              'src/js/plugins/**', 
              'src/js/app.js', 
              '!src/js/{libraries,libraries/**}'
          ])
          .pipe(plugins.plumber({
              errorHandler: function(error) {
              console.log(error.message);
              this.emit('end');
          }}))
          .pipe(plugins.concat('app.js'))
          .pipe(gulp.dest('dist/js/'))
          .pipe(plugins.rename({
              suffix: '.min'
          }))
          .pipe(plugins.uglify({
              preserveComments: 'none'
              //preserveComments: 'some'
          }))
          .pipe(gulp.dest('dist/js/')) // Seems okay up until here...
          .pipe(browserSync.reload({   // ...but this never seems to fire!
              stream: true
          }));
  
      };
  
  };
  </code></pre>
  
  <p>You'll notice I'm requiring Browser-Sync in my <code>scripts.js</code> file, but this is because doing plugins.Browser-Sync wasn't working. I read somewhere that this is because Browser-Sync is not actually a Gulp plugin.</p>
  
  <p>So whilst I don't get any errors and Browser-Sync appears to start up...from then on, my scripts task works, but it doesn't fire the BrowserSync part.</p>
  
  <p>Any help greatly appreciated!</p>
  
  <p><strong>PS</strong>, Incase it helps, here's my <code>package.json</code> file (notice that above I'm presenting you a stripped back version of my <code>gulpfile.js</code>).</p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "name": "MichaelPumo",
    "version": "1.0.0",
    "description": "A frontend Gulp project for WordPress by Michael Pumo.",
    "main": "gulpfile.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "MichaelPumo",
    "license": "MIT",
    "devDependencies": {
      "browser-sync": "2.6.5",
      "gulp-postcss": "~6.0.0",
      "autoprefixer-core": "~5.2.1",
      "gulp-sourcemaps": "~1.5.2",
      "gulp-concat": "2.5.2",
      "gulp-plumber": "1.0.0",
      "gulp-rename": "1.2.2",
      "gulp-sass": "2.0.4",
      "gulp-uglify": "1.2.0",
      "gulp": "~3.9.0",
      "node-neat": "~1.7.2",
      "gulp-svgmin": "~1.2.0",
      "gulp-image-optimization": "~0.1.3",
      "gulp-load-plugins": "~1.0.0"
    }
  }
  </code></pre>