@0x-lerna-fork/run
在每个包含脚本的软件包中运行 npm 脚本
安装 莱娜 进入 lerna CLI(英语:CLI).
使用量
$ lerna run <script> -- [..args] # runs npm run my-script in all packages that have it
$ lerna run test
$ lerna run build
# watch all packages and transpile on change, streaming prefixed output
$ lerna run --parallel watch
运行一个 npm 脚本 在包含脚本的每个软件包中。 双色( A)--)是将破折的参数传递到脚本执行中所必需的.
选项
lerna run 尊重 --concurrency, (中文(简体) ), --scope,以及 --ignore 旗帜(参见 过滤旗) (中文(简体) ).
$ lerna run --scope my-component test
--npm-client <client>
必须是知道如何运行 npm 生命周期脚本的可执行文件 .
默认 --npm-client 实值 npm。 。 。 .
$ lerna run build --npm-client=yarn
也可能配置在 lerna.json数字 :
{
"command": {
"run": {
"npmClient": "yarn"
}
}
}
--stream
立即流出子进程的产出, 并加原产出前缀 软件包名称。 这使得不同软件包的输出可以互出.
$ lerna run watch --stream
--parallel
类似 --stream,但完全忽略了同位素和地形排序,在所有匹配的包中立即运行一个给定的命令或脚本,并带有前缀流输出. 这是长期运行进程首选的旗帜, 如 npm run watch 运行过许多软件包.
$ lerna run watch --parallel
说明: 建议在使用 页:1
--parallel旗,因为产出数十个子进程 有害于您的外壳等同性( 或文件描述的最大限制, ) , (例如,A/CN.9/WG.III/WP.III/WP.1号文件)。 也门
--no-bail
# Run an npm script in all packages that contain it, ignoring non-zero (error) exit codes
$ lerna run --no-bail test
默认, lerna run 如果 任意 脚本运行返回一个非零退出代码.
过 --no-bail 要禁用此行为,将脚本运行到 全部 包,无论退出代码.
--no-prefix
在输出流出时禁用软件包名称前缀( E)--stream 或者说 --parallel) (中文(简体) ).
此选项在向编辑器插件等其它进程管道输出结果时可能有用 .