mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Add possibility to run binaries directly instead of having to alias everything #165

Open Sjeiti opened 5 years ago

Sjeiti commented 5 years ago

Not having prefix every command with npm run is very convenient but it does force you do alias every command for use in npm-run-all.

For example the following script:

"build": "del-cli dist & npm run bar & node task/foo & npx webpack --config webpack.config.js --env.development",
"bar": "node task/bar -qz"

would resolve to the following with npm-run-all:

"build": "npm-run-all clean bar foo webpack",
"clean": "del-cli dist"
"bar": "node task/bar -qz",
"foo": "node task/foo",
"webpack": "npx webpack --config webpack.config.js --env.development"

This is fine for longer tasks but feels very clumsy for short tasks. A downside (especially for large projects) is a very large and unreadable npm scripts.

It would be great if a call like npm-run-all \"eslint src/**/*.js\" webpack would just work (where eslint is a binary and webpack a command defined in package json scripts).

Sjeiti commented 5 years ago

Don't know if #10 is still on the roadmap but I see that Concurrently uses a prefix (npm:) for npm scripts. Then again, I can easily see this working without prefix by indexing npm script keys and an includes conditional.