Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IJuanTM opened this issue May 11, 2022 · 1 comment

Comments

@IJuanTM
Copy link

IJuanTM commented May 11, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants