
我的 npm 脚本:
"scripts:" { "init-component": "node ./scripts/init-component.js && node ./scripts/init-demo.js" } 执行命令行:
$ npm run init-component -- button # 等价于 node ./scripts/init-component.js && node ./scripts/init-demo.js "button" 这样只对 ./scripts/init-demo.js 脚本传入了参数 "button"。
现在我想只使用下面的命令:
$ npm run init-component -- button 同时给 ./scripts/init-component.js 和 ./scripts/init-demo.js 两个脚本都传入相同参数,应该怎么做呢?
1 VagabondH 2022-02-08 19:30:43 +08:00 ``` json "scripts": { "ttt": "node a.js ${npm_config_type} && node b.js ${npm_config_type}" } ``` ``` npm run ttt --type=button ``` |