const path = require('path');
const _ = require('lodash');
const httpProxy = require('http-proxy-middleware');

const setup = require('setup/setup');

module.exports = function() {
  const browserSync = this.context.browserSync;

  const assets = setup.assets;

  const browserSyncOpts = setup.plugins.browserSync;
  const proxyOpts = setup.plugins.httpProxyMiddleware;

  const plugins = [];
  const middleware = [];

  plugins.push({
    module: 'bs-html-injector',
    options: {
      files: [path.join(assets.build, assets.dest.docs)],
    },
  });

  _(proxyOpts.proxies).forEach((proxy) => {
    middleware.push(httpProxy(proxy.uri, proxy.options));
  });

  browserSyncOpts.plugins = plugins;
  browserSyncOpts.server.middleware = middleware;
  browserSync.init(browserSyncOpts);
};

@@ -170,16 +170,24 @@
 unction(
+taskDone
 ) %7B%0A  co
@@ -789,11 +789,25 @@
 cOpts);%0A
+  taskDone();%0A
 %7D;%0A

Add task done callback on BrowserSync task