Running npm run dev -- --foo=bar will result in concurrently --raw "npm run start" "gulp watch" "--foo=bar" which doesn't properly add the parameter to any of the commands.
The double dash -- parameter passing is part of npm run so "you can use custom arguments when executing scripts", https://docs.npmjs.com/cli/run-script
{
"scripts": {
"dev": "concurrently --raw --parameter-passthrough \"npm run start\" \"gulp watch\""
}
}
We could add an--parameter-passthrough option to concurrently that would add the last command chunk onto each command piece. The last chunk that would be considered parameters could even be separated by --.
So running npm run dev -- -- --foo=bar would result in the following after npm, concurrently --raw "npm run start" "gulp watch" "--" "--foo=bar" and then finally npm run start --foo=bar && gulp watch --foo=bar
An issue is adding the extra -- for npm run arg passing. As you can see above, for it to be effective, it would actually need to be npm run start -- --foo=bar && gulp watch --foo=bar. Perhaps the npm script should be updated to include the extra -- though: "dev": "concurrently --raw --parameter-passthrough \"npm run start --\" \"gulp watch\""
If we wanted to get fancier could even add separation with --0, --1 which would go to each indexed command chunk respectively, npm run dev -- --0 --foo=bar --1 --qux=dorf which would finally end up at npm run start -- --foo=bar && gulp watch --qux=dorf
Running
npm run dev -- --foo=barwill result inconcurrently --raw "npm run start" "gulp watch" "--foo=bar"which doesn't properly add the parameter to any of the commands.The double dash
--parameter passing is part ofnpm runso "you can use custom arguments when executing scripts", https://docs.npmjs.com/cli/run-script{ "scripts": { "dev": "concurrently --raw --parameter-passthrough \"npm run start\" \"gulp watch\"" } }We could add an
--parameter-passthroughoption toconcurrentlythat would add the last command chunk onto each command piece. The last chunk that would be considered parameters could even be separated by--.So running
npm run dev -- -- --foo=barwould result in the following afternpm,concurrently --raw "npm run start" "gulp watch" "--" "--foo=bar"and then finallynpm run start --foo=bar && gulp watch --foo=barAn issue is adding the extra
--for npm run arg passing. As you can see above, for it to be effective, it would actually need to benpm run start -- --foo=bar && gulp watch --foo=bar. Perhaps the npm script should be updated to include the extra--though:"dev": "concurrently --raw --parameter-passthrough \"npm run start --\" \"gulp watch\""If we wanted to get fancier could even add separation with
--0,--1which would go to each indexed command chunk respectively,npm run dev -- --0 --foo=bar --1 --qux=dorfwhich would finally end up atnpm run start -- --foo=bar && gulp watch --qux=dorf