Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Aug 12, 2018
1 parent 09f26fd commit f649f17
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
42 changes: 22 additions & 20 deletions bin/src/run/index.ts
Expand Up @@ -4,7 +4,6 @@ import { InputOptions } from '../../../src/rollup/types';
import mergeOptions from '../../../src/utils/mergeOptions';
import { getAliasName } from '../../../src/utils/relativeId';
import { handleError } from '../logging';
import sequence from '../utils/sequence';
import batchWarnings from './batchWarnings';
import build from './build';
import loadConfigFile from './loadConfigFile';
Expand Down Expand Up @@ -102,27 +101,30 @@ function execute(configFile: string, configs: InputOptions[], command: any) {
if (command.watch) {
watch(configFile, configs, command, command.silent);
} else {
return sequence(configs, config => {
const warnings = batchWarnings();
const { inputOptions, outputOptions, deprecations, optionError } = mergeOptions({
config,
command,
defaultOnWarnHandler: warnings.add
});

if (deprecations.length) {
inputOptions.onwarn({
code: 'DEPRECATED_OPTIONS',
message: `The following options have been renamed — please update your config: ${deprecations
.map(option => `${option.old} -> ${option.new}`)
.join(', ')}`,
deprecations
let promise = Promise.resolve();
for (const config of configs) {
promise = promise.then(() => {
const warnings = batchWarnings();
const { inputOptions, outputOptions, deprecations, optionError } = mergeOptions({
config,
command,
defaultOnWarnHandler: warnings.add
});
}

if (optionError) inputOptions.onwarn({ code: 'UNKNOWN_OPTION', message: optionError });
if (deprecations.length) {
inputOptions.onwarn({
code: 'DEPRECATED_OPTIONS',
message: `The following options have been renamed — please update your config: ${deprecations
.map(option => `${option.old} -> ${option.new}`)
.join(', ')}`,
deprecations
});
}

return build(inputOptions, outputOptions, warnings, command.silent);
});
if (optionError) inputOptions.onwarn({ code: 'UNKNOWN_OPTION', message: optionError });
return build(inputOptions, outputOptions, warnings, command.silent);
});
}
return promise;
}
}
2 changes: 1 addition & 1 deletion src/utils/transform.ts
Expand Up @@ -48,7 +48,7 @@ export default function transform(
if (result && Array.isArray(result.dependencies)) {
for (const dep of result.dependencies) {
const depId = resolve(dirname(id), dep);
if (graph.watchFiles.indexOf(depId) === -1) graph.watchFiles.push(depId);
if (!graph.watchFiles[depId]) graph.watchFiles[depId] = true;
}
}
} else {
Expand Down

0 comments on commit f649f17

Please sign in to comment.