packages/browser-sync/lib/async.js
function(bs, done) {
        var plugins = bs.options
            .get("plugins")
            .map(pluginUtils.resolvePlugin)
            .map(pluginUtils.requirePlugin);

        plugins.forEach(function(plugin) {
            if (plugin.get("errors").size) {
                return logPluginError(plugin);
            }
            var jsPlugin = plugin.toJS();
            jsPlugin.options = jsPlugin.options || {};
            jsPlugin.options.moduleName = jsPlugin.moduleName;
            bs.registerPlugin(jsPlugin.module, jsPlugin.options);
        });

        function logPluginError(plugin) {
            utils.fail(true, plugin.getIn(["errors", 0]), bs.cb);
        }

        done();
    }
function(bs, done) {
        var plugins = bs.options
            .get("plugins")
            .map(pluginUtils.resolvePlugin)
            .map(pluginUtils.requirePlugin);

        plugins.forEach(function(plugin) {
            if (plugin.get("errors").size) {
                return logPluginError(plugin);
            }
            var jsPlugin = plugin.toJS();
            jsPlugin.options = jsPlugin.options || {};
            jsPlugin.options.moduleName = jsPlugin.moduleName;
            bs.registerPlugin(jsPlugin.module, jsPlugin.options);
        });

        function logPluginError(plugin) {
            utils.fail(true, plugin.getIn(["errors", 0]), bs.cb);
        }

        done();
    }
function ( bs , done ) { var plugins = bs . options . get ( "plugins" ) . map ( pluginUtils . resolvePlugin ) . map ( pluginUtils . requirePlugin ) ; plugins . forEach ( function ( plugin ) { if ( plugin . get ( "errors" ) . size ) { return logPluginError ( plugin ) ; } var jsPlugin = plugin . toJS ( ) ; jsPlugin . options = jsPlugin . options || { } ; jsPlugin . options . moduleName = jsPlugin . moduleName ; bs . registerPlugin ( jsPlugin . module , jsPlugin . options ) ; } ) ; function logPluginError ( plugin ) { utils . fail ( true , plugin . getIn ( [ "errors" , 0 ] ) , bs . cb ) ; } done ( ) ; }
Try to load plugins that were given in options
@param {BrowserSync} bs
@param {Function} done
Try to load plugins that were given in options