Gulp as a background task
See original GitHub issueIt would be great to have gulp run as a background task, especially when things like gulp.watch
are going on, so that users don’t have to have so many terminal windows open. I’m not sure if this would have to be implemented per gulp plugin, or through Gulp as a whole. It’s just a thought though, and I’m looking to get some ideas on it, if there’s a better way to have a server running and gulp.watch
(or a similar process) running concurrently.
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
angularjs - Running Gulp in background always - Stack Overflow
We are unzipping it into a folder in server and executing the gulp serve & . The process starts fine, however exits as...
Read more >I think the answer is that gulp hasn't been designed to run as a ...
I think the answer is that gulp hasn't been designed to run as a background task (don't ask me for specifics though!), whereas...
Read more >Gulp Tasks - Dan's Cheat Sheets's documentation!
Gulp calls the task function, which returns when it's done. Even if everything your task is doing is synchronous, this is still wrong...
Read more >How to Use Gulp.js to Automate Your CSS Tasks - SitePoint
In this article, we look at how you can use Gulp.js to automate a range of repetitive CSS development tasks to speed up...
Read more >Gulp from Scratch: The Default and Watch Tasks - YouTube
Support Me ::https://www.patreon.com/alecadddhttp://www.alecaddd.com/support-me/http://amzn.to/2DsPZUnCheck out Elementor: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
gulp &
http://hacktux.com/bash/ampersand
I found that
screen
is a good tool to use for that. I’m not positive on exactly how it works, but I think it creates a new terminal instance to run the process in.I’ve been doing something similar to this:
This does the following:
screen
starts a new terminal screen-dm
forces a new session that is detached (this allows you to log out of the terminal and back in later to reconnect)-S
name the session (this is the firstgulp
above) I was experimenting without this and wasn’t getting it to work properly.-L
this logs the output toscreenlog.0
. I’m not sure if this can be changed.You can check to see if any screens are running by doing
screen -ls
. You can also reattach to a screen by doingscreen -r
(if there is only one it will attach, otherwise you’ll have to provide a name found from doingscreen -ls
.When reattached, you can do
Ctrl+c
to stop the session. You can also doCtrl+a,d
to detach from the session if you want it to keep running.I’ve also found that with the command above if you’re not running
.watch
, the session will close when the task is finished running. This is useful if it’s just a long running task that you want to check up on the progress of through thescreenlog.0
file:tail -f screenlog.0
Hope this helps. Also, this can be used for any process that might be long running.