Run task as parallel child process for each argument.
$ yarn add --dev @start/plugin-xargs
# or
$ npm install --save-dev @start/plugin-xargs
xargs(taskName: string, options?: {}): (...args: string[])
Exported task name.
maxProcesses
–Infinity
by default
import sequence from '@start/plugin-sequence'
import find from '@start/plugin-find'
import read from '@start/plugin-read'
import babel from '@start/plugin-lib-babel'
import write from '@start/plugin-write'
const babelConfig = {
// …
babelrc: false,
sourceMap: true,
}
export const task1 = (packageName) =>
sequence(
find(`${packageName}/src/**/*.js`),
read,
babel(babelConfig),
write(`${packageName}/build/`)
)
export const task2 => (...packageNames) = xargs('task1')(...packageNames)
// export const task2 = xargs('task1')