Skip to content

Commit

Permalink
feat: allow inlined plugins
Browse files Browse the repository at this point in the history
plugins = [
  'npm-module-plugin', {
  'launcher:inlinedLauncher': ['factory', ...]
];
  • Loading branch information
vojtajina committed Apr 13, 2013
1 parent 5898d0b commit 3034bcf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var reporter = require('./reporter');
var helper = require('./helper');
var EventEmitter = require('./events').EventEmitter;

var log = logger.create();


// TODO(vojta): get this whole mess under test
Expand All @@ -28,7 +29,6 @@ var start = function(injector, config, launcher, globalEmitter, preprocess, file
injector.get('framework:' + framework);
});

var log = logger.create();
var filesPromise = fileList.refresh();

if (config.autoWatch) {
Expand Down Expand Up @@ -249,7 +249,13 @@ exports.start = function(cliOptions, done) {

// register all plugins
config.plugins.forEach(function(plugin) {
modules.push(require(plugin));
if (helper.isString(plugin)) {
modules.push(require(plugin));
} else if (helper.isObject(plugin)) {
modules.push(plugin);
} else {
log.warn('Invalid plugin %s', plugin);
}
});

var injector = new di.Injector(modules);
Expand Down

0 comments on commit 3034bcf

Please sign in to comment.