Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sunnylost/rollup into sun…
Browse files Browse the repository at this point in the history
…nylost-master
  • Loading branch information
Rich-Harris committed Sep 8, 2017
2 parents cef0db2 + 0ffac58 commit 604fdda
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/src/run/mergeOptions.js
Expand Up @@ -73,14 +73,21 @@ export default function mergeOptions ( config, command ) {
paths: getOption('paths')
};

const outputOptions = (
(command.output || config.output) ?
let mergedOutputOptions;
if (Array.isArray(config.output)) {
mergedOutputOptions = config.output.map((output) => Object.assign({}, output, command.output));
} else if (config.output && command.output) {
mergedOutputOptions = [Object.assign({}, config.output, command.output)];
} else {
mergedOutputOptions = (command.output || config.output) ?
ensureArray(command.output || config.output) :
[{
file: command.output ? command.output.file : null,
format: command.output ? command.output.format : null
}]
).map(output => {
}];
}

const outputOptions = mergedOutputOptions.map(output => {
return Object.assign({}, baseOutputOptions, output);
});

Expand Down

0 comments on commit 604fdda

Please sign in to comment.