diff --git a/bin/src/runRollup.js b/bin/src/runRollup.js index 45c305e..7299d07 100644 --- a/bin/src/runRollup.js +++ b/bin/src/runRollup.js @@ -95,8 +95,15 @@ const equivalents = { }; function execute ( options, command ) { - let external = ( options.external || [] ) - .concat( command.external ? command.external.split( ',' ) : [] ); + let external = command.external ? + typeof options.external === 'function' ? + ((fn, a) => { + return function (id) { + return fn() || a.indexOf(id) !== -1; + }; + })(options.external, command.external.split(',')) : + (options.external || []).concat(command.external.split(',')) : + options.external; if ( command.globals ) { let globals = Object.create( null ); @@ -218,4 +225,4 @@ function bundle ( options ) { process.stdout.write( code ); }); -} +} \ No newline at end of file