diff --git a/lib/runner.js b/lib/runner.js index 40cddc7..97f1add 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -98,23 +98,13 @@ GruntBrowserifyRunner.prototype = _.create(GruntBrowserifyRunner.prototype, { if (options.transform) { _.forEach(options.transform, function (transformer) { - if (typeof transformer !== 'object') { - b.transform(transformer); - } - else { - b.transform(transformer[1], transformer[0]); - } + b.transform(transformer); }); } if (options.plugin) { _.forEach(options.plugin, function (plugin) { - if (typeof plugin !== 'object') { - b.plugin(plugin); - } - else { - b.plugin(plugin[0], plugin[1]); - } + b.plugin(plugin); }); } diff --git a/test/browserify.test.js b/test/browserify.test.js index 73ae74f..abc4e4a 100644 --- a/test/browserify.test.js +++ b/test/browserify.test.js @@ -270,7 +270,7 @@ describe('grunt-browserify-runner', function () { it('passes the options hash along with the transform fn', function (done) { var transforms = [[function () {}, {}]]; runner.run([], dest, {transform: transforms}, function () { - assert.ok(b().transform.calledWith(transforms[0][1], transforms[0][0])); + assert.ok(b().transform.calledWith(transforms[0])); done(); }); }); @@ -320,9 +320,9 @@ describe('grunt-browserify-runner', function () { it('registers the plugin', function (done) { var b = stubBrowserify('plugin'); var runner = createRunner(b); - var plugin = function () {}; - runner.run([], dest, {plugin: [plugin]}, function () { - assert.ok(b().plugin.calledWith(plugin)); + var plugin = [function () {}]; + runner.run([], dest, {plugin: plugin}, function () { + assert.ok(b().plugin.calledWith(plugin[0])); done(); }); }); @@ -330,10 +330,9 @@ describe('grunt-browserify-runner', function () { it('registers the plugin options', function (done) { var b = stubBrowserify('plugin'); var runner = createRunner(b); - var plugin = function () {}; - var opts = {}; - runner.run([], dest, {plugin: [[plugin, opts]]}, function () { - assert.ok(b().plugin.calledWith(plugin, opts)); + var plugin = [[function () {}, {}]]; + runner.run([], dest, {plugin: plugin}, function () { + assert.ok(b().plugin.calledWith(plugin[0])); done(); }); });