![](/img/trans.png)
[英]How to pass argument(input) in an npx command to run the npm package
[英]How to pass an argument to 2nd command when using `concurrently` with npm?
我有 2 个 npm 脚本: tsc -w
和jest --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.