繁体   English   中英

与npm一起使用`concurrent`时如何将参数传递给第二个命令?

[英]How to pass an argument to 2nd command when using `concurrently` with npm?

我有 2 个 npm 脚本: tsc -wjest --watch我想同时执行。 我知道有一个名为concurrently的工具可以用于此目的。

"test:watch": "concurrently -P --kill-others \"npm run watch\"  \"jest --watchAll -- {@} \"",

问题是我想将参数传递给 Jest 命令,而不是concurrently命令。

npm concurrently使用时如何将参数传递给第二个命令?

使用 pass-through 标志将参数从命令行传递到脚本。

"test:watch": "concurrently -P --kill-others \"npm run watch\"  \"jest --watchAll -- {@} \"",

像这样使用它:

npm run test:watch -- -- cookie

您需要使用--两次才能到达内部 Jest 脚本!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM