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

Is there a way to make sure the commands get executed in the same order every time? #231

Open IJuanTM opened 2 years ago

IJuanTM commented 2 years ago

Hi, I've been having an issue while using run-p. I have a commands that runs 3 watchers, but it is important that the first one finishes before the second one runs. But sometimes this doesn't work.

Below is an example: image

What happens is that the scss compiler runs and compiles main.scss into main.css (sass). After that a css minimizer (clean-css) runs to minimize the css file.

The problem is that sometimes the scss compiler runs AFTER the css minimizer runs and thus make the changes not show up and even go as far as for some reason breaking the css on my site, untill it runs the right way again.

So my question is: Is there any way to force the run-p command to execute commands in order everytime? Or is this not possible?

Hope to hear if someone knows!

If anyone has a different way of solving this issue that involves different commands or packages I'd be glad to hear them as well!

TehShrike commented 2 years ago

Have another npm script like "css": "run-s build:scss build:css" and have your watcher trigger that script when something changes